#Uninstaller
IF((test-path
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
{26A24AE4-039D-4CA4-87B4-2F32180131F0}') -eq 'true')
{
start-process -wait -filepath "c:\Windows\System32\msiexec.exe" -
argumentlist "/X{26A24AE4-039D-4CA4-87B4-2F32180131F0} /quiet /l*
c:\csg-bin\JavaGUIDs.txt"
#-RedirectedStandardOutput c:\csg-bin\JavaGUIDs.txt -
RedirectStandardError
c:\csg-bin\JavaGUIDs.txt -NoNewWindow
}
else
{
Write-Host "Application not found"
}
此程序的目的是使用我们学校的部署控制台卸载java。我已经在部署控制台中编写了一个有效的安装程序,但我正在尝试将卸载程序切换到PowerShell脚本。谁能弄清楚我的代码有什么问题?代码编译并运行良好,但之后仍然在计算机上安装了Java。