更新时间:2023-11-14 15:36:58
试试下面的脚本:
$RE = 'Python35'
$Key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components'
Get-ChildItem $Key -Rec -EA SilentlyContinue | ForEach-Object {
$CurrentKey = (Get-ItemProperty -Path $_.PsPath)
If ($CurrentKey -match $RE){
$CurrentKey|Remove-Item -Force -Whatif
}
}
如果输出看起来没问题,从 Remove-Item
If the output looks OK remove the -WhatIf
paramter from Remove-Item