PowerShell_Scripts/base/Add-PackageCondition.ps1

26 lines
751 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,
[string[]]$CmdletExists = $null,
[string[]]$AppExeExists = $null
)
process {
$local:newCond = New-Object -Type 'szCondition'
$newCond.custom = $CustomCondition
$newCond.System = $System
$newCond.Hostname = $Hostname
$newCond.Username = $Username
$newCond.CmdletExists = $CmdletExists
$newCond.AppExeExists = $AppExeExists
$newCond.Logic = [szLogic]::and
$InputObject.Condition += $newCond
$InputObject
}