From 2ce7846adc2197052dc356571889aef35587e9e6 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:41:48 -0500 Subject: [PATCH] Remove extra try statement --- .github/workflows/update-addns.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-addns.yaml b/.github/workflows/update-addns.yaml index fc2f312..40ebe58 100644 --- a/.github/workflows/update-addns.yaml +++ b/.github/workflows/update-addns.yaml @@ -93,17 +93,12 @@ jobs: } Write-Host "Retrieving DNS Record..." - try { - $dnsRecord = Get-DnsServerResourceRecord -ZoneName "${{ env.domainName }}" -ComputerName ${{ secrets.domainController }} | Where-Object { $_.HostName -eq "${{ env.aksIngress }}" } - if ($dnsRecord) { - Write-Host "DNS Record retrieved successfully:" - $dnsRecord | Format-List - } else { - Write-Error "DNS Record not found." - } - } - catch { - Write-Error "Failed to retrieve DNS Record." + $dnsRecord = Get-DnsServerResourceRecord -ZoneName "${{ env.domainName }}" -ComputerName ${{ secrets.domainController }} | Where-Object { $_.HostName -eq "${{ env.aksIngress }}" } + if ($dnsRecord) { + Write-Host "DNS Record retrieved successfully:" + $dnsRecord | Format-List + } else { + Write-Error "DNS Record not found." } if ($recordUpdated) {