From 8f97ffe81836b0956d86bc43a4a6b9d59716d8b8 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Fri, 11 Nov 2022 13:37:50 -0500 Subject: [PATCH] don't change location, delete working dir --- Install-ESETManagementAgent.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Install-ESETManagementAgent.ps1 b/Install-ESETManagementAgent.ps1 index 1c1f05f..1f06cfe 100644 --- a/Install-ESETManagementAgent.ps1 +++ b/Install-ESETManagementAgent.ps1 @@ -31,10 +31,10 @@ Download-File -URL $URL -File $INSTALLER # Install the app LogMsg "Installing ESET Management Agent from ""${INSTALLER}""" -Try { Set-Location -Path $TEMPDIR ; Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart /log installer.log" -Wait } +Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart /log installer.log" -Wait } Catch { LogErr $_.Exception.Message } # Delete the installer -#LogMsg "Deleting temp directory and its contents" -#Try { Remove-Item -Path $TEMPDIR -Recurse -Force -ErrorAction SilentlyContinue } -#Catch { LogErr $_.Exception.Message } +LogMsg "Deleting temp directory and its contents" +Try { Remove-Item -Path $TEMPDIR -Recurse -Force -ErrorAction SilentlyContinue } +Catch { LogErr $_.Exception.Message }