obs-powershell.psm1
:ToIncludeFiles foreach ($file in (Get-ChildItem -Path "$PSScriptRoot" -Filter "*-*.ps1" -Recurse)) { if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1 foreach ($exclusion in '\.[^\.]+\.ps1$') { if (-not $exclusion) { continue } if ($file.Name -match $exclusion) { continue ToIncludeFiles # Skip excluded files } } . $file.FullName } $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = { Get-OBSEffect | Stop-OBSEffect Disconnect-OBS } foreach ($noun in 'Streaming','Recording') { foreach ($verb in 'Start', 'Stop') { Set-Alias "$verb-$noun" "$verb-OBS$($noun -replace 'ing')" } } Connect-OBS $MyInvocation.MyCommand.ScriptBlock.Module | Import-OBSEffect |