don't wait for exit and don't delete downloaded installer
This commit is contained in:
@@ -34,11 +34,7 @@ If ( IsWindowsVersion -ge "10.0" ) {
|
|||||||
If ( Test-Path "${DOWNLOADS}\${FILENAME}" )
|
If ( Test-Path "${DOWNLOADS}\${FILENAME}" )
|
||||||
{
|
{
|
||||||
Write-Output "Launching installer: ${DOWNLOADS}\${FILENAME}"
|
Write-Output "Launching installer: ${DOWNLOADS}\${FILENAME}"
|
||||||
Try { Start-Process -FilePath "${DOWNLOADS}\${FILENAME}" -Wait }
|
Try { Start-Process -FilePath "${DOWNLOADS}\${FILENAME}" }
|
||||||
Catch { Write-Output $_.Exception.Message }
|
|
||||||
|
|
||||||
Write-Output "Deleting installer: ${DOWNLOADS}\${FILENAME}"
|
|
||||||
Try { Remove-Item "${DOWNLOADS}\${FILENAME}" }
|
|
||||||
Catch { Write-Output $_.Exception.Message }
|
Catch { Write-Output $_.Exception.Message }
|
||||||
}
|
}
|
||||||
Else { Write-Output "${DOWNLOADS}\${FILENAME} does not exist" }
|
Else { Write-Output "${DOWNLOADS}\${FILENAME} does not exist" }
|
||||||
|
|||||||
Reference in New Issue
Block a user