Si vous voulez avoir un job qui joue le rôle de sentinelle :


$url="http://10.190.200.87:8080/hudson/api/xml"
$path="c:\Temp\jobs.xml"
$expectedJobsNb=41
$client = new-object System.Net.WebClient
 #Download the hudson home page in xml, through the web service
$client.DownloadFile( $url, $path )
[xml] $content=get-Content $path
#Get the jobs list
$jobs=$content.SelectNodes("/hudson/job")

if ( $jobs.count -ne $expectedJobsNb ) {
    Write-Error "We do not have the good number of jobs $($jobs.count)"
    exit 1;
} else {
    Write-Output "We have the good number of jobs : $($jobs.count)"
}