mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-30 20:29:06 +00:00
Function that generates exclusions
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user