This commit is contained in:
2020-09-04 09:14:24 -04:00
parent e38f9bd599
commit 38d8302e6d
2 changed files with 35 additions and 3 deletions
+4 -3
View File
@@ -10,7 +10,7 @@ $TEMP = [System.IO.Path]::GetTempPath()
## Setup log file and function to write to it
$LOGFILE = "{0}EmberkomAgentSetup_{1}.log" -f $TEMP, $(Get-Date -Format "yyyyMMddHHmmss")
If (! (Test-Path $LOGFILE) ) { New-Item -Path $LOGFILE -ItemType File }
If (! (Test-Path $LOGFILE) ) { New-Item -Path $LOGFILE -ItemType File | Out-Null; Write-Output "Log file: ${LOGFILE}" }
Function Write-Log([string]$message)
{
$entry = "{0} : {1}" -f $(Get-Date -Format "yyyyMMddHHmmss"), $Message
@@ -28,7 +28,7 @@ Write-Log "CUSTOMER_ID: ${CUSTOMER_ID}"
Write-Log "SOFTWARE_ID: ${SOFTWARE_ID}"
## Build the path for $AGENT_INSTALLER
$AGENT_INSTALLER = "${TEMP}\${AGENT_FILENAME}"
$AGENT_INSTALLER = "${TEMP}${AGENT_FILENAME}"
Write-Log "Agent installer will be saved to: ${AGENT_INSTALLER}"
## Make sure the CUSTOMER_ID is specified
@@ -38,7 +38,8 @@ If ( $CUSTOMER_ID )
If ( !(Test-Path 'HKLM:SOFTWARE\N-able Technologies\NcentralAsset') -and !(Test-Path 'SOFTWARE\Wow6432Node\N-able Technologies\NcentralAsset'))
{
## Build the AGENT_URL
$AGENT_URL = "{0}{1}{2}{3}" -f 'https://manage.emberkom.com/dms/FileDownload?customerID=',$CUSTOMER_ID.ToString(),'&softwareID=',$SOFTWARE_ID.ToString()
$AGENT_URL = 'https://manage.emberkom.com/downloadAgentOrProbeSoftwareDownloadAction.action?customerId={0}&softwareId={1}' -f $CUSTOMER_ID.ToString(),$SOFTWARE_ID.ToString()
write-host $AGENT_URL
## Delete $AGENT_INSTALLER if it already exists
If ( Test-Path $AGENT_INSTALLER )