Files
management-scripts/Install-ESETManagementAgent.ps1
T

28 lines
999 B
PowerShell
Raw Normal View History

2022-09-06 11:41:22 -04:00
param(
[Parameter(Mandatory=$true)][string]$URL
)
# Source the Tools.ps1 script
Function SourceTools
{ . $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) }
. SourceTools
2022-09-02 15:16:37 -04:00
# 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 }
2022-09-06 11:41:22 -04:00
Catch { LogErr $_.Exception.Message }
# Delete this script
Remove-Item $MyInvocation.MyCommand.Path -Force