overhaul
This commit is contained in:
@@ -1,16 +1,26 @@
|
||||
param([string]$URL)
|
||||
|
||||
## Path to the MSI installer
|
||||
$INSTALLER='https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.114.msi'
|
||||
$MSIURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.114.msi'
|
||||
|
||||
## Set installer args
|
||||
If ( $URL )
|
||||
{
|
||||
If ( $URL ) {
|
||||
LogMsg "LiquidFiles target server: ${URL}"
|
||||
$INSTALLER_ARGS = "REGKEYSCRIPT=`"BaseUrl=${URL};`""
|
||||
}
|
||||
Else { $INSTALLER_ARGS = '' }
|
||||
|
||||
## Run the installer
|
||||
#Install-Program -Path "msiexec" -Arguments "/i ${INSTALLER} /qn /norestart ${INSTALLER_ARGS}"
|
||||
Start-Process "msiexec.exe" -Arguments "/i ${INSTALLER} /qn /norestart ${INSTALLER_ARGS}"
|
||||
$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 {
|
||||
If ( Test-Path $INSTALLER ) {
|
||||
LogMsg "Deleting downloaded installation package"
|
||||
Remove-Item $INSTALLER -Force
|
||||
}
|
||||
}
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Reference in New Issue
Block a user