Skip to content

Commit d59710d

Browse files
committed
Remove unimplemented Management cmdlets from Unix
These are not currently implemented and so should not show up as available. The *-Computer cmdlets are already not compiled for Unix (and so not available), so let's not declare them in the manifest. The Get-ComputerInfo cmdlet does not work on Unix and so should not be made available. Test-Connection depends on an unavailable WMI provider. Get/Set-TimeZone are not yet ported.
1 parent f68cb8c commit d59710d

2 files changed

Lines changed: 31 additions & 17 deletions

File tree

src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ ModuleVersion="3.1.0.0"
77
PowerShellVersion="3.0"
88
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
99
HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390785'
10-
AliasesToExport = @("gin", "gtz", "stz")
1110
FunctionsToExport = @()
1211
CmdletsToExport=@("Add-Content",
1312
"Clear-Content",
@@ -48,21 +47,6 @@ CmdletsToExport=@("Add-Content",
4847
"Remove-ItemProperty",
4948
"Rename-ItemProperty",
5049
"Resolve-Path",
51-
"Get-Service",
52-
"Stop-Service",
53-
"Start-Service",
54-
"Suspend-Service",
55-
"Resume-Service",
56-
"Restart-Service",
57-
"Set-Service",
58-
"New-Service",
5950
"Set-Content",
60-
"Set-ItemProperty",
61-
"Test-Connection",
62-
"Restart-Computer",
63-
"Stop-Computer",
64-
"Rename-Computer",
65-
"Get-ComputerInfo",
66-
"Get-TimeZone",
67-
"Set-TimeZone")
51+
"Set-ItemProperty")
6852
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" {
2+
3+
$Commands = @(
4+
"Get-Service",
5+
"Stop-Service",
6+
"Start-Service",
7+
"Suspend-Service",
8+
"Resume-Service",
9+
"Restart-Service",
10+
"Set-Service",
11+
"New-Service",
12+
13+
"Restart-Computer",
14+
"Stop-Computer",
15+
"Rename-Computer",
16+
17+
"Get-ComputerInfo",
18+
19+
"Test-Connection",
20+
21+
"Get-TimeZone",
22+
"Set-TimeZone"
23+
)
24+
25+
foreach ($Command in $Commands) {
26+
It "$Command should only be available on Windows" {
27+
[bool](Get-Command $Command -ErrorAction SilentlyContinue) | Should Be $IsWindows
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)