diff --git a/Install-ESETManagementAgent.ps1 b/Install-ESETManagementAgent.ps1 new file mode 100644 index 0000000..2d1e279 --- /dev/null +++ b/Install-ESETManagementAgent.ps1 @@ -0,0 +1,17 @@ +# NOTE: $URL must be set in calling script! + +# Download the installer +$INSTALLER = '{0}epi_win_live_installer.exe' -f (GetTempPath) +LogMsg "Downloading ESET Management Agent live installer" +Try { Invoke-WebRequest -Uri $URL -UseBasicParsing -OutFile $INSTALLER } +Catch { LogErr $_.Exception.Message } + +# Install the app +LogMsg "Installing ESET Management Agent from ""${INSTALLER}""" +Try { Start-Process "${INSTALLER}" -ArgumentList "--silent --accepteula" -Wait } +Catch { LogErr $_.Exception.Message } + +# Delete the installer +LogMsg "Deleting downloaded installer ""${INSTALLER}""" +Try { Remove-Item -Path $INSTALLER -Force -ErrorAction SilentlyContinue } +Catch { LogErr $_.Exception.Message } \ No newline at end of file