provisioner/powershell: Don't over complicate removal of tmp output file

This commit is contained in:
DanHam 2017-01-26 11:21:45 +00:00
parent 21be983855
commit 370b67497e
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 0 additions and 4 deletions

View File

@ -82,11 +82,7 @@ do {
} while (!($t.state -eq 3)) } while (!($t.state -eq 3))
$result = $t.LastTaskResult $result = $t.LastTaskResult
if (Test-Path $log) { if (Test-Path $log) {
try {
Takeown /F $log | Out-Null
Icacls $log /Grant:r Administrators:F /c /q 2>&1 | Out-Null
Remove-Item $log -Force -ErrorAction SilentlyContinue | Out-Null Remove-Item $log -Force -ErrorAction SilentlyContinue | Out-Null
} catch { $Global:Error.RemoveAt(0) }
} }
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($s) | Out-Null [System.Runtime.Interopservices.Marshal]::ReleaseComObject($s) | Out-Null
exit $result`)) exit $result`))