Public/Renderer/Disable-ASLightByName.ps1
function Disable-ASLightByName { Param( [String]$Shell, [Parameter(Mandatory, Position=0)][string]$name ) # first, get Shell we want to talk to $shellLocal = Get-ASDefaultShell if($PSBoundParameters['Shell']) { $shellLocal = $Shell } if([System.String]::IsNullOrEmpty($shellLocal)) { Write-Host 'Target shell is not set. Please specify target shell with -Shell parameter or by Set-ASDefaultShellTarget snippet.' return } $uri = "http://$($shellLocal):4444/api/renderer/DisableLightsByName?name=$($name)" $result = Invoke-RestMethod -Uri $uri -Method POST Write-Host $result } |