Skip to content

Instantly share code, notes, and snippets.

@isa
Created January 19, 2012 18:51
Show Gist options
  • Save isa/1641809 to your computer and use it in GitHub Desktop.
Save isa/1641809 to your computer and use it in GitHub Desktop.
Stupid powershell returns object[] instead of string
function Trigger-Builds($WaitForCore = $True) {
$ServiceUrl = 'http://jenkins:8080/job/e3.components.omt.services.OrderService.v1.1'
$LastServiceBuildNumber = Get-LastSuccessfulBuildNumber "$ServiceUrl/rssAll"
$ServiceVersion = 0
$ServiceBuildResult = Trigger-Build "$ServiceUrl/build"
Write-Host "Building service now.."
while ($ServiceBuildResult) {
Sleep -Seconds 20
$Version = Get-LatestVersionAfter $LastServiceBuildNumber "$ServiceUrl/rssAll"
Write-Host "Latest version after $LastServiceBuildNumber is $Version"
if ($Version -ge 0) {
$ServiceVersion = $Version
break
}
}
Write-Host $ServiceVersion.GetType() # this is string
return $ServiceVersion # this becomes an array, but at this point it's still a string..
}
$v = Trigger-Builds $False
$v.GetType() # this is object[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment