1
- $CommandsPath = (Join-Path $PSScriptRoot " Commands" )
2
- :ToIncludeFiles foreach ($file in (Get-ChildItem - Path " $CommandsPath " - Filter " *-*.ps1" - Recurse)) {
3
- if ($file.Extension -ne ' .ps1' ) { continue } # Skip if the extension is not .ps1
4
- foreach ($exclusion in ' \.[^\.]+\.ps1$' ) {
5
- if (-not $exclusion ) { continue }
6
- if ($file.Name -match $exclusion ) {
7
- continue ToIncludeFiles # Skip excluded files
8
- }
9
- }
10
- . $file.FullName
1
+ param ()
2
+
3
+ if ((-not (Test-Path ' .git' )) -or $args -match ' production' ) {
4
+ . $PSScriptRoot / allcommands.ps1
5
+ } else {
6
+ $CommandsPath = (Join-Path $PSScriptRoot " Commands" )
7
+ :ToIncludeFiles foreach ($file in (Get-ChildItem - Path " $CommandsPath " - Filter " *-*.ps1" - Recurse)) {
8
+ if ($file.Extension -ne ' .ps1' ) { continue } # Skip if the extension is not .ps1
9
+ foreach ($exclusion in ' \.[^\.]+\.ps1$' ) {
10
+ if (-not $exclusion ) { continue }
11
+ if ($file.Name -match $exclusion ) {
12
+ continue ToIncludeFiles # Skip excluded files
13
+ }
14
+ }
15
+ . $file.FullName
16
+ }
11
17
}
12
18
19
+
20
+
13
21
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
14
22
Get-OBSEffect | Stop-OBSEffect
15
23
if (${obs-powershell}.Beat.Timer ) {
@@ -27,6 +35,7 @@ if ($home) {
27
35
New-PSDrive - Name " my-$ ( $MyModule.Name ) " - Root (Join-Path $home " .$ ( $myModule.Name ) " ) - Description " My $MyModule " @NewDriveSplat
28
36
}
29
37
38
+ # region obs-powershell startup
30
39
foreach ($noun in ' Streaming' , ' Recording' ) {
31
40
foreach ($verb in ' Start' , ' Stop' ) {
32
41
Set-Alias " $verb -$noun " " $verb -OBS$ ( $noun -replace ' ing' ) "
@@ -47,4 +56,6 @@ if (Test-Path $ModuleProfilePath) {
47
56
. $ModuleProfilePath
48
57
}
49
58
59
+ # endregion obs-powershell startup
60
+
50
61
Export-ModuleMember - Function * - Variable $script :variablesToExport - Alias *
0 commit comments