22 lines
589 B
PowerShell
22 lines
589 B
PowerShell
|
[CmdletBinding(SupportsShouldProcess)]param(
|
||
|
[Parameter(mandatory=$true, ValueFromPipeline=$true)]
|
||
|
[szPackage]$InputObject,
|
||
|
[szLogic]$logic = "and",
|
||
|
[ScriptBlock]$CustomCondition,
|
||
|
[string[]]$System = $null,
|
||
|
[string[]]$Hostname = $null,
|
||
|
[string[]]$Username = $null
|
||
|
)
|
||
|
|
||
|
process {
|
||
|
$local:newCond = New-Object -Type 'szCondition'
|
||
|
$newCond.custom = $CustomCondition
|
||
|
$newCond.System = $System
|
||
|
$newCond.Hostname = $Hostname
|
||
|
$newCond.Username = $null
|
||
|
$newCond.Logic = [szLogic]::and
|
||
|
$InputObject.Condition += $newCond
|
||
|
|
||
|
$InputObject
|
||
|
}
|