Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefajers authored Mar 1, 2024
1 parent b56ba7b commit 86d2303
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/functions/Invoke-AzOpsPush.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
# Check each failed removal and attempt to get the associated resource
foreach ($fail in $removeActionFail) {
$resource = $null
$resource = Get-AzOpsResource -ScopeObject $fail.ScopeObject
$resource = Get-AzOpsResource -ScopeObject $fail.ScopeObject -ErrorAction SilentlyContinue
# If the resource is found, log the failure
if ($resource) {
$throwFail = $true
Expand Down
2 changes: 1 addition & 1 deletion src/internal/functions/Remove-AzOpsDeployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
$resourceScopeObject = $null
# Check if the resource exists
$resourceScopeObject = New-AzOpsScope -Scope $change.FullyQualifiedResourceId -WhatIf:$false
$resource = Get-AzOpsResource -ScopeObject $resourceScopeObject
$resource = Get-AzOpsResource -ScopeObject $resourceScopeObject -ErrorAction SilentlyContinue
if ($resource) {
$results = 'What if successful:{1}Performing the operation:{1}Deletion of target resource {0}.' -f $resourceScopeObject.Scope, [environment]::NewLine
$allResults += $results
Expand Down
4 changes: 2 additions & 2 deletions src/internal/functions/Remove-AzResourceRaw.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Status = 'success'
}
# Check if the resource exists
$resource = Get-AzOpsResource -ScopeObject $ScopeObject
$resource = Get-AzOpsResource -ScopeObject $ScopeObject -ErrorAction SilentlyContinue
# Remove the resource if it exists
if ($resource) {
try {
Expand All @@ -54,7 +54,7 @@
while ($gone -eq $false -and $attempt -le $maxAttempts) {
Write-AzOpsMessage -LogLevel InternalComment -LogString 'Remove-AzResourceRaw.Resource.CheckExistence' -LogStringValues $ScopeObject.Scope
Start-Sleep -Seconds 10
$tryResource = Get-AzOpsResource -ScopeObject $ScopeObject
$tryResource = Get-AzOpsResource -ScopeObject $ScopeObject -ErrorAction SilentlyContinue
if (-not $tryResource) {
$gone = $true
}
Expand Down

0 comments on commit 86d2303

Please sign in to comment.