mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-28 19:27:28 +00:00
24 lines
700 B
PowerShell
24 lines
700 B
PowerShell
function New-GPOZaurrExclusions {
|
|
[cmdletBinding()]
|
|
param(
|
|
[Array] $ExclusionsArray,
|
|
[ScriptBlock] $ExclusionsScriptBlock
|
|
)
|
|
|
|
if ($ExclusionsArray) {
|
|
[string] $Code = @(
|
|
'$Exclusions = @('
|
|
[System.Environment]::NewLine
|
|
foreach ($Exclusion in $ExclusionsArray) {
|
|
" `"$Exclusion`"" + [System.Environment]::NewLine
|
|
}
|
|
[System.Environment]::NewLine
|
|
')'
|
|
)
|
|
$Code
|
|
} elseif ( $ExclusionsScriptBlock ) {
|
|
throw "ExclusionsScriptBlock is not supported yet"
|
|
} else {
|
|
throw "ExclusionsArray or ExclusionsScriptBlock must be specified"
|
|
}
|
|
} |