This project includes source to create a binary PowerShell cmdlet. The module will allow you to interact with TFS using PowerShell.
The TFVC PowerShell module is intended to aid in TFS source control operations. Similiar to using Visual Studio or tf.exe the PowerShell should provide the same capabilities.
##Compile Requirements
- Visual Studio or Xamarin
- .NET Framework 4.6 or Mono
##Runtime Requirements
- PowerShell 3.0 or later
- .NET Framework 4.6 or later
To unload and load the compiled module the below syntax can be used:
###Unload Module
###################################################################################
# Unload module
###################################################################################
if ((Get-Module -Name "TFVC.PowerShell") -ne $null) {
Write-Host -ForegroundColor Yellow "`r`nRemoving module [TFVC.PowerShell"
Remove-Module -Name "TFVC.PowerShell" -Force | Out-Null
}
###################################################################################
###Import Module
###################################################################################
# Load module
###################################################################################
Import-Module "TFVC.PowerShell.psd1" -Force
###################################################################################
###List Modules
Get-Module
Get-Command -Module "PwC.GATT.PowerShell.Common" -CommandType cmdlet | Format-Table
##Features The below features should be available to the PowerShell cmdlet's
- Connect to TFS (Connect-Tfs)
- Disconnect from TFS (Disconnect-Tfs)
- Create Workspace (Create-TfsWorkspace)
- Delete Workspace (Delete-TfsWorkspace)
- Workspace exist (Exist-TfsWorkspace)
- Server path exist (Exist-TfsServerPath)
- Workspace mapping exist (Exist-TfsWorkspaceMapping)
- Create Workspace mapping (Create-TfsWorkspaceMapping)
- Get workspace (Get-TfsWorkspace)
- Get items from TFS (Get-TfsItems)
- Check-out item from TFS (CheckOut-TfsItem)
- Check-in item to TFS (CheckIn-TfsItem)
- Undo item from TFS (Undo-TfsItem)
- Create branch in TFS (Create-TfsBranch)
###Connect to TFS server
###################################################################################
# Connect to TFS
###################################################################################
Import-Module "TFVC.PowerShell.psd1" -Force
Connect-Tfs -Uri "http://mytfsserver.localhost.com:8080/tfs/DefaultCollection"
###################################################################################
###Disconnect from TFS server
###################################################################################
# Disconnect from TFS
###################################################################################
Disconnect-Tfs
###################################################################################