From e0fe437e1e288c3c430b0d181b531f094b8e980e Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Fri, 13 Aug 2021 12:25:38 +0200 Subject: [PATCH] Small exclusion improvement --- Public/Skip-GroupPolicy.ps1 | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Public/Skip-GroupPolicy.ps1 b/Public/Skip-GroupPolicy.ps1 index 9ce9b46..9083927 100644 --- a/Public/Skip-GroupPolicy.ps1 +++ b/Public/Skip-GroupPolicy.ps1 @@ -27,22 +27,21 @@ .NOTES General notes #> - [cmdletBinding()] + [cmdletBinding(DefaultParameterSetName = 'Name')] param( #[ValidateSet('GPOList')][string] $Type, - [alias('GpoName', 'DisplayName')][string] $Name, + [parameter(ParameterSetName = 'Name')][alias('GpoName', 'DisplayName')][string] $Name, + [parameter(ParameterSetName = 'Guid')] + [alias('ID')][string] $GUID, + [parameter(ParameterSetName = 'Name')] + [parameter(ParameterSetName = 'Guid')] [string] $DomaiName ) - #if ($Type) { - # [PSCustomObject] @{ - # Type = $Type - # Name = $Name - # DomainName = $DomaiName - # } - #} else { - [PSCustomObject] @{ + $Output = @{ Name = $Name + ID = $GUID DomainName = $DomaiName } - #} + Remove-EmptyValue -Hashtable $Output + [PSCustomObject] $Output } \ No newline at end of file