在 powershell 中静默卸载 teamviewer 不适用于无声争论,有人知道我做错了什么吗?
我正在使用 Powershell 脚本通过 RMM 软件安装和卸载不同的程序。通常这些脚本运行没有问题,但我注意到 teamviewer 会卡住。我在本地尝试了以下卸载命令,发现 teamviewer 会给出提示,即使命令中的参数用于静默卸载。
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList "/S" -PassThru
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -Argument "/silent" -PassThru
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList '/S','/v','/qn' -passthru
有谁知道我做错了什么或解决方法是什么或不同的解决方案? 我找到了这个解决方案: https://silentinstallhq.com/teamviewer-install-and-卸载-powershell/ 但这不是我想要的,我不想安装不同的程序只是为了能够默默地卸载 TeamViewer。
I am using Powershell scripts to install and uninstall different programs trough RMM software. Usually those scripts run without a problem but i noticed for teamviewer it gets stuck. I tried the following uninstall commands locally and found out teamviewer gives a prompt even though the arguments in the command are for a silent uninstall.
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList "/S" -PassThru
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -Argument "/silent" -PassThru
Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList '/S','/v','/qn' -passthru
Does anybody know what i am doing wrong or what a workaround can be or a different solution?
I found this solution: https://silentinstallhq.com/teamviewer-install-and-uninstall-powershell/
But that is not what i am looking for, i don't want to install a different program just to be able to uninstall TeamViewer silently.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了这个问题。令人惊讶的是,我从未发现它通过谷歌搜索得到解决,但我发现修复非常简单,而且它特定于 PowerShell。
注意:我喜欢旧的 CMD
net stop
命令,因为如果我使用 PSstop-process -Name TeamViewer*
命令,TeamViewer 就会重新启动。最重要的是,在 PowerShell 中,您需要使用 PS 转义字符 `(左上角的键,与 ~ 相同的键)对 / 开关进行转义。 S 也区分大小写。必须是大写。
I ran into this problem, too. Surprisingly, I never found it solved through google searches but I discovered the fix was quite easy, and it's specific to PowerShell.
Notes: I like the old CMD
net stop
command because TeamViewer would just restart if I use the PSstop-process -Name TeamViewer*
command.Most importantly, in PowerShell, you need to escape the / switch with the PS escape character ` (top-left key, same key as ~). The S is also case sensitive. Must be uppercase.