尝试识别Chrome的setup.exe,然后执行静默卸载。Get-ChildItem在不定义变量$LocalVersion的情况下工作。需要调用$LocalVersion来执行卸载。有任何线索吗?
# Uninstalling Chrome
$LocalVersion = (Get-ChildItem -Path "C:\Program Files\Google\Chrome\Application" -Filter "setup.exe" -Recurse -ErrorAction SilentlyContinue -Force | %{$_.FullName}).name
Start-Process -FilePath "$LocalVersion" -ArgumentList '-uninstall --system.level --multi-install --force-uninstall' -Verbose #-ErrorAction SilentlyContinue
Start-Sleep 10
调用$LocalVersion-Variable
1条答案
按热度按时间b1payxdu1#
尝试从变量中删除
().Name
。它不会产生任何结果