Skip to content

Commit 2418639

Browse files
author
Kapil Borle
committed
Add documentation to New-CommandDataFile.ps1
1 parent 67eb2ac commit 2418639

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Utils/New-CommandDataFile.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
<#
2+
.SYNOPSIS
3+
Create a JSON file containing module found in $pshome and their corresponding exported commands
4+
5+
.EXAMPLE
6+
C:\PS> ./New-CommandDataFile.ps1
7+
8+
Suppose this file is run on the following version of PowerShell: PSVersion = 6.0.0-aplha, PSEdition = Core, and Windows 10 operating system. Then this script will create a file named core-6.0.0-alpha-windows.json that contains a JSON object of the following form:
9+
{
10+
"Modules" : [
11+
"Module1" : {
12+
"Name" : "Module1"
13+
.
14+
.
15+
"ExportedCommands" : {...}
16+
}
17+
.
18+
.
19+
.
20+
]
21+
"JsonVersion" : "0.0.1"
22+
}
23+
24+
.INPUTS
25+
None
26+
27+
.OUTPUTS
28+
None
29+
30+
#>
31+
132
$jsonVersion = "0.0.1"
233
$builtinModulePath = Join-Path $pshome 'Modules'
334
if (-not (Test-Path $builtinModulePath))

0 commit comments

Comments
 (0)