Remove-WindowsFeature

Remove specified roles, role services, and features from a computer that is running Windows Server 2008 R2.

Syntax
      Remove-WindowsFeature [-Name] string[] [-logPath string]
         [-WhatIf] [-Restart] [-Concurrent]  [CommonParameters]

Key
   -Name string
       The command IDs of roles, role services, or features to remove.
       Alternatively, an array of Feature objects will also be accepted.
       You can find a list of command IDs for all roles, role services, and features in the
       topic "Overview of Server Manager Commands" in the Server Manager Help.

   -logPath string
       The name and location of a log file, other than the default, %windir%\logs\ServerManager.log.

   -WhatIf
       Describe what would happen if you executed the command,  without actually
       executing the command. This will also display any Windows features that
       would be removed due to dependencies.

   -Restart
       Restart the computer automatically when removal is complete,
       if restarting is required by the roles or features removed.

   -Concurrent
       Allow concurrent instances of Add-WindowsFeature or Remove-WindowsFeature
       to run at the same time.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Examples

Remove both Telnet Server and Telnet Client:

C:\PS> Remove-WindowsFeature Telnet-Server,Telnet-Client

Remove all Web features, including dependencies:

C:\PS> Get-WindowsFeature Web-* | Remove-WindowsFeature

"No amount of time can erase the memory of a good cat, and no amount of masking tape can ever totally remove his fur from your couch" ~ Leo F. Buscaglia

Related PowerShell Commands:

Add-WindowsFeature - Install roles, role services, and features
Get-WindowsFeature - Retrieve roles, role services, and features


Copyright © SS64.com 1999-2018
Some rights reserved