Uninstall-SPFeature

解除安裝已安裝的功能定義。

Syntax

Uninstall-SPFeature
         [-Identity] <SPFeatureDefinitionPipeBind>
         [-AssignmentCollection <SPAssignmentCollection>]
         [-CompatibilityLevel <Int32>]
         [-Confirm]
         [-Force]
         [-WhatIf]
         [<CommonParameters>]

Description

Cmdlet Uninstall-SPFeature 會從伺服陣列中的功能定義集合中移除指定的功能定義。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱位於 SharePoint Server Cmdlets 的線上文件。

範例

------------------範例 1-----------------------

Uninstall-SPFeature -Identity "MyCustomFeature"

此範例會解除安裝 $env:ProgramFiles\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\MyCustomFeature/feature.xml 中的功能。

------------------範例 2-----------------------

Uninstall-SPFeature -Identity "MyCustomFeature" -CompatibilityLevel 14

此範例會解除安裝 $env:ProgramFiles\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\MyCustomFeature/feature.xml 中的功能。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-CompatibilityLevel

指定要解除安裝的功能版本。 未指定版本時,會預設為 Web 應用程式 MaxVersion 值。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

在執行命令之前,提示您確認操作。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Force

強制解除安裝已安裝的功能。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要解除安裝的功能或 GUID 名稱。

此類型必須是位於 :\program files\common files\Microsoft Shared\Web server extensions\15\template\features 資料夾中的 <drive> 功能資料夾名稱,或必須是 GUID,格式為 21d186e1-7036-4092-a825-0eb6709e9281。

Type:SPFeatureDefinitionPipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition