From 56c722edd077e0576839378802ca59d5e5e2648b Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Tue, 9 Feb 2021 10:54:43 +0100 Subject: [PATCH] Small fix to exclude GPOList.xml --- Public/Get-GPOZaurr.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Public/Get-GPOZaurr.ps1 b/Public/Get-GPOZaurr.ps1 index 3a2b705..f1acd80 100644 --- a/Public/Get-GPOZaurr.ps1 +++ b/Public/Get-GPOZaurr.ps1 @@ -100,9 +100,11 @@ foreach ($Path in $GPOPath) { Write-Verbose "Get-GPOZaurr - Getting GPO content from XML files" Get-ChildItem -LiteralPath $Path -Recurse -Filter *.xml | ForEach-Object { - $XMLContent = [XML]::new() - $XMLContent.Load($_.FullName) - Get-XMLGPO -OwnerOnly:$OwnerOnly.IsPresent -XMLContent $XMLContent -PermissionsOnly:$PermissionsOnly.IsPresent -ExcludeGroupPolicies $ExcludeGPO -Type $Type + if ($_.Name -ne 'GPOList.xml') { + $XMLContent = [XML]::new() + $XMLContent.Load($_.FullName) + Get-XMLGPO -OwnerOnly:$OwnerOnly.IsPresent -XMLContent $XMLContent -PermissionsOnly:$PermissionsOnly.IsPresent -ExcludeGroupPolicies $ExcludeGPO -Type $Type + } } Write-Verbose "Get-GPOZaurr - Finished GPO content from XML files" }