$path = $env:HOMEDRIVE+"\windows.old"
If(Test-Path -Path $path)
{
#创建注册表值
$regpath = "HKLM:\华体会体育系列SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\先前安装"
New-ItemProperty -Path $regpath -Name "StateFlags1221" -PropertyType DWORD -Value 2 -Force | Out-Null
#启动清洁应用程序
Start-Process "$env:SystemRoot\System32\cleanmgr.exe" -ArgumentList "/sagerun:1221"
等待进程名称“cleanmgr”
}