PowerShell_Scripts/base/Add-PackageCondition.ps1

22 lines
589 B
PowerShell
Raw Normal View History

[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
}