mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +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]"
|
||||
} catch {
|
||||
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'"
|
||||
} catch {
|
||||
Write-Host "##vso[task.LogIssue type=error;]Failed to move VM '$VMName' to target datastore '$TargetDataStore'"
|
||||
exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -86,4 +88,5 @@ try {
|
||||
$vm | Set-VM -NumCPU $CpuCount -CoresPerSocket $CoresPerSocketCount -MemoryMB $Memory -Confirm:$false -ErrorAction Stop | Out-Null
|
||||
} catch {
|
||||
Write-Host "##vso[task.LogIssue type=error;]Failed to change specs for VM '$VMName'"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user