【问题标题】:Uninstall all apps without those installed by me the user with get-appxpackage使用 get-appxpackage 卸载所有未由我安装的应用程序
【发布时间】: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


    【解决方案1】:

    Windows 包管理器(截至今天 2021 年 10 月 7 日)不会记录它在系统上安装的内容。将来有工作要添加,但目前无法知道应用安装的来源。

    【讨论】:

      猜你喜欢
      • 2019-12-13
      • 1970-01-01
      • 1970-01-01
      • 2019-07-03
      • 2018-08-22
      • 2012-12-26
      • 1970-01-01
      • 2014-08-11
      • 1970-01-01
      相关资源
      最近更新 更多