This commit is contained in:
2020-05-22 14:35:46 -04:00
parent c5b16d024c
commit 7907fe891b
15 changed files with 198 additions and 59 deletions
+23
View File
@@ -0,0 +1,23 @@
[CmdletBinding()]
param(
[string]$AGENT_URL,
[string]$AGENT_FILENAME='EmberkomAgentSetup.exe'
)
$TEMP = [System.IO.Path]::GetTempPath()
$AGENT_INSTALLER = "${TEMP}\${AGENT_FILENAME}"
## Make sure the AGENT_URL is specified
If ( $AGENT_URL )
{
## Make sure we need to install the agent
If ( !(Test-Path 'HKLM:SOFTWARE\N-able Technologies\NcentralAsset') -and !(Test-Path 'SOFTWARE\Wow6432Node\N-able Technologies\NcentralAsset'))
{
## Download the agent
If ( Test-Path $AGENT_INSTALLER ) { Remove-Item $AGENT_INSTALLER -Force }
(New-Object System.Net.WebClient).DownloadFile("${AGENT_URL}", $AGENT_INSTALLER)
## Install the agent
Start-Process $AGENT_INSTALLER -ArgumentList '/quiet /passive' -Wait
}
}