mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 07:46:57 +00:00
Add exit 1 to each error case (#5092)
This commit is contained in:
@@ -71,6 +71,7 @@ if ($env:AGENT_JOBSTATUS -eq 'Failed') {
|
|||||||
Write-Host "VM has been successfully powered off and renamed to [${VMName}_failed]"
|
Write-Host "VM has been successfully powered off and renamed to [${VMName}_failed]"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "##vso[task.LogIssue type=error;]Failed to power off and rename VM '$VMName'"
|
Write-Host "##vso[task.LogIssue type=error;]Failed to power off and rename VM '$VMName'"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ try {
|
|||||||
Write-Host "VM has been moved successfully to target datastore '$TargetDataStore'"
|
Write-Host "VM has been moved successfully to target datastore '$TargetDataStore'"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "##vso[task.LogIssue type=error;]Failed to move VM '$VMName' to target datastore '$TargetDataStore'"
|
Write-Host "##vso[task.LogIssue type=error;]Failed to move VM '$VMName' to target datastore '$TargetDataStore'"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -86,4 +88,5 @@ try {
|
|||||||
$vm | Set-VM -NumCPU $CpuCount -CoresPerSocket $CoresPerSocketCount -MemoryMB $Memory -Confirm:$false -ErrorAction Stop | Out-Null
|
$vm | Set-VM -NumCPU $CpuCount -CoresPerSocket $CoresPerSocketCount -MemoryMB $Memory -Confirm:$false -ErrorAction Stop | Out-Null
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "##vso[task.LogIssue type=error;]Failed to change specs for VM '$VMName'"
|
Write-Host "##vso[task.LogIssue type=error;]Failed to change specs for VM '$VMName'"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user