-
Notifications
You must be signed in to change notification settings - Fork 32
Function ServerFeature
Mark Wragg edited this page Jun 17, 2019
·
1 revision
Test if a Windows Server feature is installed.
Uses the Get-WindowsFeature
cmdlet to test if a Windows feature is installed.
This cmdlet does not work on a desktop operating system to retieve the list of locally installed features and as such is not currently supported on the desktop.
The Windows Server feature name to test.
[Parameter(Mandatory, Position=1)]
The optional property on the feature to test for. If not specified, will default to the 'Installed' property.
[Parameter(Position=2, ParameterSetName='prop')]
[ValidateSet(
'BestPracticesModelId',
'DependsOn',
'Depth',
'DisplayName',
'FeatureType',
'Installed',
'InstallState',
'Name',
'Notification',
'Parent',
'Path',
'ServerComponentDescriptor',
'SubFeatures',
'SystemService'
)]
A Script Block defining a Pester Assertion.
[Parameter(Mandatory, Position=2, ParameterSetName='noprop')]
[Parameter(Mandatory, Position=3, ParameterSetName='prop')]
Assertions: -Be, -BeNullOrEmpty
ServerFeature Web-Server { Should be $true }
ServerFeature TelnetClient { Should -Be $false }
ServerFeature Web-Server InstallState { Should -Be 'Installed' }
ServerFeature Remote-Access InstallState { Should -Be 'Available' }
Getting Started
Contributing
Functions