Created
January 19, 2012 18:51
-
-
Save isa/1641809 to your computer and use it in GitHub Desktop.
Stupid powershell returns object[] instead of string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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