Skip to content

Commit 976c755

Browse files
authored
Reverted cmdlet error check and added -Force for New-AzResourceGroup (#21087)
1 parent 0258961 commit 976c755

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tools/TestFx/Live/LiveTestUtility.psm1

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function New-LiveTestResourceGroup {
143143
[string] $Location = "westus"
144144
)
145145

146-
$rg = Invoke-LiveTestCommand -Command "New-AzResourceGroup -Name $Name -Location $Location"
146+
$rg = Invoke-LiveTestCommand -Command "New-AzResourceGroup -Name $Name -Location $Location -Force"
147147
$rg
148148
}
149149

@@ -188,12 +188,7 @@ function Invoke-LiveTestCommand {
188188

189189
$cmdResult = Invoke-Expression -Command $Command -ErrorAction Stop
190190

191-
if ($LASTEXITCODE -eq 0) {
192-
Write-Host "##[section]Successfully executed the command `"$Command`"" -ForegroundColor Green
193-
}
194-
else {
195-
throw "Error occurred when executing the command `"$Command`"."
196-
}
191+
Write-Host "##[section]Successfully executed the command `"$Command`"" -ForegroundColor Green
197192

198193
$cmdResult
199194
break

0 commit comments

Comments
 (0)