如何在powershell中存储我的应用程序的真实名称

时间:2015-05-21 15:51:00

标签: powershell

我是Powershell的新手,我想编写一个脚本来删除Windows 8应用程序。我的文件名每次都会更改,但通常会有' wardobs'在里面。所以我使用这行代码来查找应用程序。get-appxpackage –Name *wardobs*然后我复制包系列名称,将其粘贴到这行代码Remove-AppxPackage package family name中,然后删除我的应用程序。我没有必要将软件包系列名称粘贴到我的代码中,而是如何找到包含' wardobs'在它的名字。将包系列名称存储在变量中,并在我的最后一行代码中使用该变量来删除应用程序?

1 个答案:

答案 0 :(得分:0)

# Get all packages, where name of the package matches *wardobs*
$Appx = Get-AppxPackage –Name *wardobs*

# Your code here

# Remove all packages stored in the $Appx variable
$Appx | Remove-AppxPackage