【发布时间】:2021-09-17 22:34:04
【问题描述】:
我想卸载 Windows 上预装的所有应用程序,而不卸载我安装的那些应用程序。我知道我可以按名称指定应用程序,但我想在安装应用程序时运行此脚本而不手动更新它。
我的脚本是这样的
Get-AppxPackage -allusers | where-object {$_.name –notlike "*store*"} | where-object {$_.name –notlike "*calculator*"} | where-object {$_.name –notlike "*terminal*"} | where-object {$_.name –notlike "*winget*"} | where-object {$_.name –notlike "*DesktopAppInstaller*"} | where-object {$_.name –notlike "*Microsoft.VCLibs.140.00.UWPDesktop*"} | where-object {$_.name –notlike "*DesktopAppInstaller*"} | Remove-AppxPackage
我可以将其更改为始终卸载我不想保留在我的 Windows 安装中的应用程序,如下所示:
get-appxpackage -allusers *3dbuilder* | remove-appxpackage
get-appxpackage -allusers *alarms* | remove-appxpackage
get-appxpackage -allusers *appconnector* | remove-appxpackage
然而这也是相当手动的,只要窗口不断添加其他糟糕的应用程序,我仍然需要找到并将其添加到我的列表中。
我能否以某种方式找到用户手动安装的应用程序?通过安装文件或使用 winget。 或者我是否需要制作一个程序来安装我的应用程序以保存已安装应用程序的 id(即如果它们是使用 winget 安装的)?
【问题讨论】:
标签: powershell windows-10 appx winget