Uninstall-WindowsFeature

Windows Server 2012 R2 and Windows 8.1

Uninstall-WindowsFeature

Uninstalls specified Windows Server roles, role services, and features from a computer that is running Windows Server 2012 R2. By adding the Remove parameter, also deletes feature files, or payload, from a computer. This cmdlet replaces Remove-WindowsFeature, the cmdlet that was used to uninstall roles, role services, and features in Windows Server 2008 R2.

별칭

다음 약어는 이 cmdlet의 별칭입니다.

  • Remove-WindowsFeature

구문

Parameter Set: RunningComputer
Uninstall-WindowsFeature [-Name] <Feature[]> [-ComputerName <String> ] [-Credential <PSCredential> ] [-IncludeManagementTools] [-LogPath <String> ] [-Remove] [-Restart] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VhdPath
Uninstall-WindowsFeature [-Name] <Feature[]> [-ComputerName <String> ] [-Credential <PSCredential> ] [-IncludeManagementTools] [-LogPath <String> ] [-Remove] [-Vhd <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




자세한 설명

The Uninstall-WindowsFeature cmdlet uninstalls and optionally removes specified roles, role services, and features from a computer that is running Windows Server 2012 R2, or from an offline virtual hard disk (VHD) on which Windows Server 2012 R2 is installed. This cmdlet works similarly to the in 서버 관리자, with an important exception: by default, management tools are not uninstalled when you run the Uninstall-WindowsFeature cmdlet; you must add the IncludeManagementTools parameter to uninstall associated management tools.

This cmdlet requires elevation; you must be running a Windows PowerShell session as an administrator to use this cmdlet.

매개 변수

-ComputerName<String>

Uninstalls and optionally removes one or more from a specified remote computer. This parameter accepts only one computer name. If this parameter is not added, or no computer name is specified, the default target is the local computer.

Valid values for the parameter include a NetBIOS name, an IP address, or a fully qualified domain name of a remote computer that is running Windows Server.

To use an IP address of a remote computer as the value of this parameter, your command must include the Credential parameter. The computer must either be configured for HTTPS transport, or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For information about adding a computer name to the WinRM TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting.


별칭

Cn

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Credential<PSCredential>

Specifies a user account that has access rights to perform this action. If the parameter is not added, or no value is specified, the default value of this parameter is the current user. Enter a user name in one of the following formats. Quotation marks are optional.

-- "UserName"

-- "Domain\User"

-- "User@Domain.com"

-- A Credential object returned by the Get-Credential cmdlet.

If a user name is entered, then a prompt for a password is displayed.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-IncludeManagementTools

Specifies the uninstallation of all applicable management tools along with the roles, role services, or features that are specified in the Name parameter. Note that by default, management tools are not uninstalled when you run the Uninstall-WindowsFeature cmdlet; you must add this parameter to uninstall associated management tools.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-LogPath<String>

Specifies a name and path to a log file. Add this parameter if the results of this cmdlet must be stored in a log.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Name<Feature[]>

Specifies a list of features to uninstall. This parameter does not support wildcard characters.


별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-Remove

Deletes feature files for the specified from the side-by-side store, located at %SystemDrive%:\Windows\WinSxS. If the feature is not yet uninstalled, the command uninstalls the feature.

When you delete feature files, features that depend upon the files you remove are also deleted. When you delete feature files for a subfeature, and no other subfeatures for the parent feature are installed, then files for the entire parent role or feature are deleted.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Restart

Specifies that the target computer is restarted automatically, if a restart is required by the uninstallation process for the specified roles or features. This parameter cannot be used with the Vhd parameter.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Vhd<String>

Specifies the path to an offline VHD. The path can either point to a VHD file, or to a location on which the VHD is already mounted by using Deployment Image Servicing and Management (DISM) tools.

The VHD can be on a local disk on the target computer, or on a network shared folder. If the VHD is in a network shared folder, then the value of this parameter is a UNC path to the VHD. In this case, the computer account of the computer that you are using to mount the VHD must have read and write permissions (Read/Write permissions in the File Sharing dialog box, or Full Control on the Security tab of the folder Properties dialog box) on the shared folder, or the VHD will not be accessible. Local loopback UNC paths are not supported. Use either of the following formats for the computer account: DOMAIN\SERVERNAME$ or SERVERNAME$.

Add the ComputerName parameter to specify the target computer you want to use to mount the VHD. If the ComputerName parameter is not specified, then the local computer is used. The computer that you are using to mount the VHD must be running Windows Server 2012 R2. Any local path, such as D:\myFolder, that is specified by using this parameter is always relative to the target computer.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • System.String[]
  • Microsoft.Windows.ServerManager.Commands.Feature[]

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • Microsoft.Windows.ServerManager.Commands.FeatureOperationResult

예제

EXAMPLE 1

This example uninstalls any roles or features that are currently installed on the target server.


PS C:\> Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $TRUE } | Uninstall-WindowsFeature

EXAMPLE 2

This example removes Web Server (IIS) from Server1, including all role services. The user account specified to perform the operation is contoso\user1.


PS C:\> Uninstall-WindowsFeature -Name Web-Server -ComputerName Server1 -Credential contoso\user1

EXAMPLE 3

This example deletes the feature files for any roles or features that currently are not installed on the local server.


PS C:\> Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $FALSE } | Uninstall-WindowsFeature –Remove

관련 항목

커뮤니티 추가 항목

추가
표시: