Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Utility/ARM/Stop-AzureV2VMs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ else {
foreach ($VM in $VMs) {
$StopRtn = $VM | Stop-AzureRmVM -Force -ErrorAction Continue

if (!$StopRtn.IsSuccessStatusCode) {
if ($StopRtn.Status -ne "Succeeded") {
# The VM failed to stop, so send notice
Write-Output ($VM.Name + " failed to stop")
Write-Error ($VM.Name + " failed to stop. Error was:") -ErrorAction Continue
Expand All @@ -115,4 +115,4 @@ foreach ($VM in $VMs) {
# The VM stopped, so send notice
Write-Output ($VM.Name + " has been stopped")
}
}
}