2022-01-19 21:52:59 +00:00
|
|
|
. $PSScriptRoot\meta.ps1
|
2021-08-23 15:24:05 +01:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
class Special {
|
2021-08-23 15:24:05 +01:00
|
|
|
# Constructor
|
|
|
|
Special()
|
|
|
|
{
|
2022-01-19 21:52:59 +00:00
|
|
|
AddCommandMembers -PARAMS @('restart', 'shutdown', 'show')
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[String] Getter($param) {
|
2022-01-09 14:24:09 +00:00
|
|
|
return Write-Warning("ERROR: Usage: $param")
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-01-09 14:24:09 +00:00
|
|
|
[void] Setter($param, $val = $true) {
|
|
|
|
Param_Set -PARAM $param -VALUE $(if ($val) {1} else {0})
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[String] cmd ($arg) {
|
|
|
|
return "Command.$arg"
|
|
|
|
}
|
|
|
|
|
|
|
|
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
|
|
|
{
|
2022-01-09 14:24:09 +00:00
|
|
|
$this.Getter($this.cmd('DialogShow.VBANCHAT'))
|
2021-08-23 15:24:05 +01:00
|
|
|
}`
|
|
|
|
{
|
2022-01-09 14:24:09 +00:00
|
|
|
param( [bool]$arg )
|
|
|
|
$this._showvbanchat = $this.Setter($this.cmd('DialogShow.VBANCHAT'), $arg)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_lock = $($this | Add-Member ScriptProperty 'lock' `
|
|
|
|
{
|
|
|
|
$this._lock = $this.Getter($this.cmd('lock'))
|
|
|
|
}`
|
|
|
|
{
|
|
|
|
param( [bool]$arg )
|
|
|
|
$this._lock = $this.Setter($this.cmd('lock'), $arg)
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-01-19 19:06:41 +00:00
|
|
|
Function Make_Command {
|
2021-08-23 15:24:05 +01:00
|
|
|
return [Special]::new()
|
|
|
|
}
|