如何使用Windows Powershell卸载ClickOnce客户端应用程序?
尝试使用以下命令:
Get-WmiObject Win32_Product -Filter "name='xxxx'"
但是,使用上述命令时,ClickOnce应用程序不会显示出来。但对于其他应用程序有效。(获取所有内容而不使用筛选器也不包含ClickOnce应用程序。但它在添加/删除程序UI中可见)
请帮忙解决。
提前感谢您的帮助。
如何使用Windows Powershell卸载ClickOnce客户端应用程序?
尝试使用以下命令:
Get-WmiObject Win32_Product -Filter "name='xxxx'"
但是,使用上述命令时,ClickOnce应用程序不会显示出来。但对于其他应用程序有效。(获取所有内容而不使用筛选器也不包含ClickOnce应用程序。但它在添加/删除程序UI中可见)
请帮忙解决。
提前感谢您的帮助。
$InstalledApplicationNotMSI = Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach-object {Get-ItemProperty $_.PsPath}
$UninstallString = $InstalledApplicationNotMSI | ? { $_.displayname -eq "YourAppicationDisplayName" } | select uninstallstring
cmd /c $UninstallString.UninstallString
$InstalledApplicationNotMSI = Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach-object {Get-ItemProperty $_.PsPath}
$UninstallString = $InstalledApplicationNotMSI | ? { $_.displayname -match "[your app process name]" } | select UninstallString
$wshell = new-object -com wscript.shell
$selectedUninstallString = $UninstallString.UninstallString
$wshell.run("cmd /c $selectedUninstallString")
Start-Sleep 5
$wshell.sendkeys("`"OK`"~")