Improve temp files deletion

This commit is contained in:
DESKTOP-V026VQF\Home 2023-03-14 19:57:08 +05:30
parent e3a22f7c7a
commit 53950f1876

View File

@ -22,5 +22,6 @@ $content = $prefix + $response
Set-Content -Path $FilePath -Value $content
Start-Process $FilePath $ScriptArgs -Wait
$item = Get-Item -LiteralPath $FilePath
$item.Delete()
$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }