Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否使用PowerShell卸载ClickOnce应用程序?_Powershell_Clickonce_Wmi - Fatal编程技术网

是否使用PowerShell卸载ClickOnce应用程序?

是否使用PowerShell卸载ClickOnce应用程序?,powershell,clickonce,wmi,Powershell,Clickonce,Wmi,是否可以使用windows powershell卸载一次点击客户端应用程序 获取WmiObject Win32_产品-筛选器“name='xxxx'” 当我在上面使用时,单击应用程序不会显示。但它可以与其他应用程序一起使用。(在没有过滤器的情况下获取所有内容也不包含click once应用程序。但它在添加/删除程序UI中可见) 请帮忙 提前感谢。请阅读以下内容: 评论后编辑: $InstalledApplicationNotMSI=Get-ChildItem HKCU:\Software\Mi

是否可以使用windows powershell卸载一次点击客户端应用程序

获取WmiObject Win32_产品-筛选器“name='xxxx'”

当我在上面使用时,单击应用程序不会显示。但它可以与其他应用程序一起使用。(在没有过滤器的情况下获取所有内容也不包含click once应用程序。但它在添加/删除程序UI中可见)

请帮忙

提前感谢。

请阅读以下内容:

评论后编辑:

$InstalledApplicationNotMSI=Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach对象{Get-ItemProperty$\.PsPath}
$UninstallString=$InstalledApplicationNotMSI |?{$\.displayname-eq“yourapplicationdisplayname”}选择卸载字符串
cmd/c$UninstallString.UninstallString
问题是,这不是一个无声的不安装。
您必须为sendkey()TAB+ENTER添加代码,以使其处于静默状态。

以下是一个简单的PowerShell脚本,用于卸载ClickOnce应用程序(其中DisplayName=您的应用程序进程名)并处理UI:

$InstalledApplicationNotMSI=Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach对象{Get-ItemProperty$\.PsPath}
$UninstallString=$InstalledApplicationNotMSI |?{$\.displayname-匹配“[您的应用程序进程名称]”}选择卸载字符串
$wshell=新对象-com wscript.shell
$selectedUninstallString=$UninstallString.UninstallString
$wshell.run(“cmd/c$selectedUninstallString”)
开始睡眠5
$wshell.sendkeys(“`OK`”~”)

非常感谢您的回答!:)我以前确实看到过这个链接,不确定它是否正确回答了我的问题。而且,它相当古老。让我在这里重复我的问题。是否可以使用WMI/Powershell获取clickonce安装的应用程序的引用?在阅读了我链接中的旧文章之后,我在编辑中构建了解决方案!:-)