1. 程式人生 > 實用技巧 >使用PowerShell從Windows 8刪除多個現代應用程式

使用PowerShell從Windows 8刪除多個現代應用程式

modern_uninstall_top

There are numerous modern apps that are a built into Windows 8 and they are featured prominently on the Start screen. It may well be the case that you don’t want to use them because they just aren’t apps you’re interested in, or it may be that you have found a better alternative.

Windows 8內建了許多現代應用程式,並且在“開始”螢幕上突出顯示了這些功能。 可能是您不想使用它們,因為它們並不是您不感興趣的應用,或者您找到了更好的選擇。

You can right click a tile and selecting the uninstall option, but if you want to remove multiple apps at once you can do so with a PowerShell Script. You can also use this technique to uninstall multiple apps you have installed from the Store.

您可以右鍵單擊磁貼並選擇解除安裝選項,但是如果要一次刪除多個應用程式,則可以使用PowerShell指令碼執行。 您還可以使用此技術來解除安裝已從商店安裝的多個應用程式。

modern_uninstall_1

You can download a readymade script from the TechNet Script Centerthat can be used to select all of the modern apps you want to remove, and uninstall them all at once. Download the script and extract it from the zip file.

您可以從TechNet指令碼中心下載現成的指令碼,該指令碼可用於選擇要刪除的所有現代應用程式,並立即將其全部解除安裝。 下載指令碼並將其從zip檔案中解壓縮。

modern_uninstall_2

Launch PowerShell in Administrator mode by pressing the Windows key to bring up the Start screen and then type Powershell. Right click the Windows PowerShell icon and then click the ‘Run as administrator’ button at the bottom of the screen before clicking Yes in the User Account Control dialog.

通過按Windows鍵以啟動“開始”螢幕,然後鍵入Powershell,以管理員模式啟動PowerShell。 右鍵單擊Windows PowerShell圖示,然後單擊螢幕底部的“以管理員身份執行”按鈕,然後在“使用者帳戶控制”對話方塊中單擊“是”。

modern_uninstall_3

Run the script by typing its full path at the command prompt and then press Enter.

通過在命令提示符下鍵入其完整路徑來執行指令碼,然後按Enter。

modern_uninstall_4

You will see a list of all of the modern apps you have installed. This list includes apps that you have installed and those that are built into Windows 8.

您將看到已安裝的所有現代應用程式的列表。 該列表包括您已安裝的應用程式以及Windows 8中內建的應用程式。

Each app has a number next to it and you can use these to specify which apps should be uninstalled. Just enter all of the app numbers, separated by commas, and press Enter.

每個應用程式旁邊都有一個數字,您可以使用這些數字指定應解除安裝的應用程式。 只需輸入所有應用程式編號(用逗號分隔),然後按Enter。

modern_uninstall_5

Confirm the action and after a moment or two the selected apps will be removed for you.

確認操作,一兩分鐘後,所選的應用將為您刪除。

Should you change your mind about an app you have removed, you can easily reinstate it from the Store.

如果您對已刪除的應用程式改變主意,則可以輕鬆從Store恢復該應用程式

It may be that you would like to remove all modern apps form your hard drive, and if this is the case you have a couple of options available to you.

可能是您希望從硬碟驅動器中刪除所有現代應用程式,如果是這種情況,則可以使用幾個選項。

The first option can be used to remove all apps from the account you are currently logged into. Launch PowerShell as an administrator and type the following command before pressing Enter:

第一個選項可用於從您當前登入的帳戶中刪除所有應用程式。 以管理員身份啟動PowerShell,並在按Enter之前鍵入以下命令:

Get-AppxPackage | Remove-AppxPackage

Get-AppxPackage | Remove-AppxPackage

Secondly, you can use the following command to remove all modern apps from all user accounts:

其次,您可以使用以下命令從所有使用者帳戶中刪除所有現代應用程式:

Get-AppxPackage -AllUsers | Remove-AppxPackage

Get-AppxPackage -AllUsers | Remove-AppxPackage

翻譯自: https://www.howtogeek.com/138752/use-powershell-to-remove-multiple-modern-apps-from-windows-8/