provisioner/powershell: Don't over complicate removal of tmp output file
This commit is contained in:
parent
21be983855
commit
370b67497e
|
@ -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`))
|
||||||
|
|
Loading…
Reference in New Issue