Update vban.ps1

add scriptproperty enable to vban object
This commit is contained in:
onyx-and-iris 2022-01-11 17:19:02 +00:00
parent 093cfe0e85
commit 5395b8873f

View File

@ -184,6 +184,7 @@ class VbanOutstream : Vban {
} }
} }
Function Vban { Function Vban {
[System.Collections.ArrayList]$instream = @() [System.Collections.ArrayList]$instream = @()
[System.Collections.ArrayList]$outstream = @() [System.Collections.ArrayList]$outstream = @()
@ -195,8 +196,19 @@ Function Vban {
[void]$outstream.Add([VbanOutstream]::new($_)) [void]$outstream.Add([VbanOutstream]::new($_))
} }
[PSCustomObject]@{ $CustomObject = [PSCustomObject]@{
instream = $instream instream = $instream
outstream = $outstream outstream = $outstream
}
$CustomObject | Add-Member ScriptProperty 'enable' `
{
return Write-Warning("ERROR: vban.enable is write only")
}`
{
param( [bool]$arg )
Param_Set -PARAM 'vban.Enable' -VALUE $(if ($arg) {1} else {0})
} }
$CustomObject
} }