-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetNovaCliCommandHelpDefinition.ps1
More file actions
41 lines (35 loc) · 1011 Bytes
/
Copy pathGetNovaCliCommandHelpDefinition.ps1
File metadata and controls
41 lines (35 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function Get-NovaCliHelpCommandNameList {
[CmdletBinding()]
param()
return @(
'init'
'info'
'version'
'build'
'test'
'package'
'deploy'
'bump'
'update'
'notification'
'publish'
'release'
)
}
function Get-NovaCliCommandHelpFilePath {
[CmdletBinding()]
param(
[Parameter(Mandatory)][string]$Command
)
return Get-ResourceFilePath -FileName "cli/help/$Command.psd1"
}
function Get-NovaCliCommandHelpDefinition {
[CmdletBinding()]
param(
[Parameter(Mandatory)][string]$Command
)
if ((Get-NovaCliHelpCommandNameList) -notcontains $Command) {
Stop-NovaOperation -Message "Unknown command: <$Command> | Use 'nova --help' to see available commands." -ErrorId 'Nova.Validation.UnknownCliCommand' -Category InvalidArgument -TargetObject $Command
}
return Import-PowerShellDataFile -Path (Get-NovaCliCommandHelpFilePath -Command $Command)
}