Examples/Start-VisualStudioCloudLoadTest.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
[cmdletbinding()] Param( [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [string] $LoadTestFileName, [Parameter(Mandatory = $False)] [ValidateNotNullOrEmpty()] [string] $LoadTestDescription = "LoadTest", [Parameter(Mandatory = $False)] [validatescript({ if (Test-Path $_ -PathType Container){ $True } else{ Throw "Invalid folder path '$_'" } })] [string] $TestDirectoryPath, [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [string] $VisualStudioAccountName, [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [string] $VisualStudioAccountPersonalAccessToken, [Parameter(Mandatory = $False)] [bool] $OutputTeamCityServiceMessages = $True ) try{ Import-Module -Name VisualStudioCloudLoadTest -Force -ErrorAction Stop -Verbose:$false Invoke-CloudLoadTest -LoadTestFileName $LoadTestFileName -LoadTestDescription $LoadTestDescription -TestDirectoryPath $TestDirectoryPath -VisualStudioAccountName $VisualStudioAccountName -VisualStudioAccountPersonalAccessToken $VisualStudioAccountPersonalAccessToken -OutputTeamCityServiceMessages $OutputTeamCityServiceMessages } catch{ throw $_ } |