From 54168dfb728071f83624876a8e0ce52fd0ab2f7e Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 20 Feb 2024 15:51:39 -0400 Subject: [PATCH] Fix DCDIAG and added Diagrammer.Core Module dependency --- .github/workflows/Release.yml | 4 ++++ Src/Private/Get-AbrADDCDiag.ps1 | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index ab0c84a..206ce9b 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -25,6 +25,10 @@ jobs: shell: pwsh run: | Install-Module -Name PScriboCharts -Repository PSGallery -Force + - name: Install Diagrammer.Core module + shell: pwsh + run: | + Install-Module -Name Diagrammer.Core -Repository PSGallery -Force - name: Install Diagrammer.Microsoft.AD module shell: pwsh run: | diff --git a/Src/Private/Get-AbrADDCDiag.ps1 b/Src/Private/Get-AbrADDCDiag.ps1 index 7f25f4e..22658ff 100644 --- a/Src/Private/Get-AbrADDCDiag.ps1 +++ b/Src/Private/Get-AbrADDCDiag.ps1 @@ -30,7 +30,7 @@ function Get-AbrADDCDiag { } process { - if ($DC) { + if (Test-Connection -ComputerName $DC -Quiet -Count 2) { try { $DCDIAG = Invoke-DcDiag -DomainController $DC if ($DCDIAG) { @@ -92,9 +92,10 @@ function Get-AbrADDCDiag { } catch { Write-PScriboMessage -IsWarning "Active Directory DCDiag Section: $($_.Exception.Message)" } + } else { + Write-PScriboMessage -IsWarning "Active Directory DCDiag Section: Unable to connect to DC server $DC." } } end {} - } \ No newline at end of file