PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1

29 lines
701 B
PowerShell

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" {
$Commands = @(
"Get-Service",
"Stop-Service",
"Start-Service",
"Suspend-Service",
"Resume-Service",
"Restart-Service",
"Set-Service",
"New-Service",
"Restart-Computer",
"Rename-Computer",
"Get-ComputerInfo",
"Set-TimeZone"
)
foreach ($Command in $Commands) {
It "$Command should only be available on Windows" {
[bool](Get-Command $Command -ErrorAction SilentlyContinue) | Should -Be $IsWindows
}
}
}