Powershell脚本卸载Chrome

xxslljrj  于 2023-04-27  发布在  Go
关注(0)|答案(1)|浏览(126)

尝试识别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

b1payxdu

b1payxdu1#

尝试从变量中删除().Name。它不会产生任何结果

相关问题