diff --git a/examples/cli/CLI.ps1 b/examples/cli/CLI.ps1 index f67fb83..1242cfc 100644 --- a/examples/cli/CLI.ps1 +++ b/examples/cli/CLI.ps1 @@ -1,7 +1,7 @@ [cmdletbinding()] param( [switch]$interactive, - [String]$kind = "banana", + [String]$kind = 'banana', [String[]]$script = @() ) @@ -20,20 +20,20 @@ function get-value { function msgHandler { param([object]$vmr, [string]$line) - $line + " passed to handler" | Write-Debug - if ($line[0] -eq "!") { - "Toggling " + $line.substring(1) | Write-Debug + $line + ' passed to handler' | Write-Debug + if ($line[0] -eq '!') { + 'Toggling ' + $line.substring(1) | Write-Debug $retval = get-value -vmr $vmr -line $line.substring(1) $vmr.Setter($line.substring(1), 1 - $retval) } - elseif ($line.Contains("=")) { + elseif ($line.Contains('=')) { "Setting $line" | Write-Debug $vmr.SendText($line) } else { "Getting $line" | Write-Debug $retval = get-value -vmr $vmr -line $line - $line + " = " + $retval | Write-Host + $line + ' = ' + $retval | Write-Host } } @@ -50,7 +50,7 @@ function main { $vmr = Connect-Voicemeeter -Kind $kind if ($interactive) { - "Press to exit" | Write-Host + 'Press to exit' | Write-Host read-hostuntilempty -vmr $vmr return } diff --git a/examples/nextbus/GoTo-NextBus.ps1 b/examples/nextbus/GoTo-NextBus.ps1 index a6ebd3c..eb90efb 100644 --- a/examples/nextbus/GoTo-NextBus.ps1 +++ b/examples/nextbus/GoTo-NextBus.ps1 @@ -13,14 +13,14 @@ param() Import-Module ..\..\lib\Voicemeeter.psm1 try { - $vmr = Connect-Voicemeeter -Kind "potato" + $vmr = Connect-Voicemeeter -Kind 'potato' $buses = @($vmr.bus[1], $vmr.bus[2], $vmr.bus[4], $vmr.bus[6]) "Buses in selection: $($buses)" $unmutedIndex = $null # 1) - "Cycling through bus selection to check for first unmuted Bus..." | Write-Host + 'Cycling through bus selection to check for first unmuted Bus...' | Write-Host foreach ($bus in $buses) { # 2) if (-not $bus.mute) { diff --git a/examples/obs/Vm-Obs-Sync.ps1 b/examples/obs/Vm-Obs-Sync.ps1 index 44d7f76..75f3911 100644 --- a/examples/obs/Vm-Obs-Sync.ps1 +++ b/examples/obs/Vm-Obs-Sync.ps1 @@ -6,28 +6,28 @@ Import-Module obs-powershell function CurrentProgramSceneChanged { param([System.Object]$data) - Write-Host "Switched to scene", $data.sceneName + Write-Host 'Switched to scene', $data.sceneName switch ($data.sceneName) { - "START" { + 'START' { $vmr.strip[0].mute = !$vmr.strip[0].mute } - "BRB" { + 'BRB' { $vmr.strip[0].gain = -8.3 } - "END" { + 'END' { $vmr.strip[0].mono = $true } - "LIVE" { + 'LIVE' { $vmr.strip[0].color_x = 0.3 } - default { "Expected START, BRB, END or LIVE scene" | Write-Warning; return } + default { 'Expected START, BRB, END or LIVE scene' | Write-Warning; return } } } function ExitStarted { param([System.Object]$data) - "OBS shutdown has begun!" | Write-Host + 'OBS shutdown has begun!' | Write-Host break } @@ -38,12 +38,12 @@ function eventHandler($data) { } function ConnFromFile { - $configpath = Join-Path $PSScriptRoot "config.psd1" + $configpath = Join-Path $PSScriptRoot 'config.psd1' return Import-PowerShellDataFile -Path $configpath } function main { - $vmr = Connect-Voicemeeter -Kind "basic" + $vmr = Connect-Voicemeeter -Kind 'basic' $conn = ConnFromFile $job = Watch-OBS -WebSocketURI "ws://$($conn.host):$($conn.port)" -WebSocketToken $conn.password