24 lines
827 B
PowerShell
24 lines
827 B
PowerShell
param([string]$URL)
|
|
|
|
## Path to the MSI installer
|
|
$MSIURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.114.msi'
|
|
|
|
## Set installer args
|
|
If ( $URL ) {
|
|
LogMsg "LiquidFiles target server: ${URL}"
|
|
$INSTALLER_ARGS = "REGKEYSCRIPT=`"BaseUrl=${URL};`""
|
|
}
|
|
Else { $INSTALLER_ARGS = '' }
|
|
|
|
## Run the installer
|
|
$INSTALLER = Download-File -URL $MSIURL
|
|
LogMsg "Installing Liquid Files Outlook Agent from ""${INSTALLER}"""
|
|
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart ${INSTALLER_ARGS}" -Wait -ErrorAction Stop }
|
|
Catch { LogErr $_.Exception.Message }
|
|
|
|
## Delete installer
|
|
Try {
|
|
LogMsg "Deleting downloaded installation package"
|
|
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
|
|
}
|
|
Catch { LogErr $_.Exception.Message } |