Different ways to get a Windows Feature list, installed or not.
Get-WindowsOptionalFeature -Online | Where State
Get-WindowsOptionalFeature -Online | Where State -eq Enabled
Get-WindowsOptionalFeature -Online | Where State -eq Disabled
For every 1603 in the World
Different ways to get a Windows Feature list, installed or not.
Get-WindowsOptionalFeature -Online | Where State
Get-WindowsOptionalFeature -Online | Where State -eq Enabled
Get-WindowsOptionalFeature -Online | Where State -eq Disabled
Different ways to get Windows Feature list, installed or not.
Get-WindowsFeatures
Get-WindowsFeatures | Where Installed
Get-WindowsFeatures | Where Installed -ne $true
Remove a Windows feature from a running installation and use the return code for further action.
Import-Module ServerManager
$status = Remove-WindowsFeature Server-Media-Foundation
if ($status.Success -eq $true)
{if ($status.RestartNeeded -eq "Yes")
{$exitCode=3010}} else {$exitCode=-1}
[Environment]::Exit($exitCode)
Add a Windows feature to a running installation and use the return code for further action.
Import-Module ServerManager
$status = Add-WindowsFeature Server-Media-Foundation
if ($status.Success -eq $true)
{if ($status.RestartNeeded -eq "Yes")
{$exitCode=3010}} else {$exitCode=-1}
[Environment]::Exit($exitCode)