小编Jay*_*oor的帖子

Powershell卸载脚本 - 真的很头疼

我目前正在编写一个脚本,其中包含许多安装在WES 7设备上的程序卸载.我需要卸载的其中一个应用程序(VMware Horizo​​n View Client)要求重新启动.如果这是脚本的一部分,它似乎接受默认按钮(是)并继续重启设备.因此脚本失败了.

我非常感谢您帮助我们如何防止重启.

仅供参考:此脚本通过管理工具发送,并在目标上以提升的方式运行.

这是我的脚本:

set-executionpolicy unrestricted
#############################################################
# Un-install unwanted applications
#############################################################
$application = Get-WMIObject Win32_Product -filter "Name='ThinPrint Client Windows 8.6'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='2X Client'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='Adobe Reader X (10.1.4)'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='VMware Horizon View Client'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='VERDE VDI User Tools'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='vWorkspace Connector for Windows'"
$application.Uninstall()

#############################################################
# Remove Internet Explorer Access …
Run Code Online (Sandbox Code Playgroud)

powershell

5
推荐指数
1
解决办法
5525
查看次数

标签 统计

powershell ×1