Skip to content

Commit 29ba784

Browse files
author
James Brundage
committed
Adding help topics for obs-powershell-commands and obs-powershell-websocket-commands
1 parent 59efe42 commit 29ba784

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
obs-powershell-commands
2+
-----------------------
3+
4+
obs-powershell exports `|{($importedModule = Import-Module ..\ -Global -PassThru).ExportedCommands.Count}|` commands
5+
(`|{$importedModule.ExportedFunctions.Count}|` functions and `|{$importedModule.ExportedAliases.Count}|` aliases)
6+
7+
A good number of these commands directly correspond to an obs-websocket message.
8+
For a complete list, see [obs-powershell-websocket-commands](docs/obs-powershell-websocket-commands.md).
9+
10+
11+
Functions
12+
=========
13+
14+
~~~PipeScript{
15+
[PSCustomObject]@{
16+
Table =
17+
$importedModule.ExportedFunctions.Values |
18+
Sort-Object Name |
19+
.Name {
20+
"[$($_.Name)]($("docs/$($_.Name).md"))"
21+
} .Synopsis
22+
}
23+
}
24+
~~~
25+
26+
27+
Aliases
28+
=======
29+
~~~PipeScript{
30+
[PSCustomObject]@{
31+
Table =
32+
$importedModule.ExportedFunctions.Values |
33+
Sort-Object Name |
34+
.Name {
35+
"[$($_.Name)]($("docs/$($_.Name).md"))"
36+
} .ResolvedCommand
37+
}
38+
}
39+
~~~
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
obs-powershell-websocket-commands
2+
---------------------------------
3+
4+
`|{($importedModule = Import-Module ..\ -Global -PassThru)}|`
5+
6+
Many of the commands communicate directly with [obs-websocket](https://github.com/obsproject/obs-websocket)
7+
and are are generated by [PipeScript](https://github.com/StartAutomating/PipeScript).
8+
9+
~~~PipeScript {
10+
$exportedCmds = $importedModule.ExportedCommands.Values |
11+
Where-Object {
12+
$_.ScriptBlock.Attributes.Key -eq 'OBS.WebSocket.RequestType'
13+
}
14+
[PSCustomObject]@{
15+
Table = $exportedCmds |
16+
.Name {
17+
"[$($_.Name)]($("docs/$($_.Name).md"))"
18+
} .RequestType {
19+
$cmd = $_
20+
foreach ($attr in $cmd.ScriptBlock.Attributes) {
21+
if ($attr.Key -eq 'OBS.WebSocket.RequestType') {
22+
"[$($attr.Value)](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#$($attr.Value.ToLower()))"
23+
}
24+
}
25+
}
26+
}
27+
}
28+
~~~
29+

0 commit comments

Comments
 (0)