Public/Renderer/Enable-ASLightByName.ps1
function Enable-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/EnableLightsByName?name=$($name)" $result = Invoke-RestMethod -Uri $uri -Method POST Write-Host $result } |