add $FORCE param
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)][int]$CUSTOMER_ID,
|
[Parameter(Mandatory=$true)][int]$CUSTOMER_ID,
|
||||||
[Parameter(Mandatory=$true)][string]$INTEGRATOR_ID,
|
[Parameter(Mandatory=$true)][string]$INTEGRATOR_ID,
|
||||||
[Parameter(Mandatory=$false)][string]$AGENT_FILENAME="EmberkomAgentSetup.exe"
|
[Parameter(Mandatory=$false)][string]$AGENT_FILENAME="EmberkomAgentSetup.exe",
|
||||||
|
[Parameter(Mandatory=$true)][switch]$FORCE=$true
|
||||||
)
|
)
|
||||||
|
|
||||||
## Source the Tools.ps1 script
|
## Source the Tools.ps1 script
|
||||||
@@ -13,8 +14,9 @@ Function SourceTools
|
|||||||
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
||||||
|
|
||||||
## Make sure we need to install the agent
|
## Make sure we need to install the agent
|
||||||
If ( !(Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe") )
|
If ( Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe" ) { $INSTALL = $false } Else { $INSTALL = $true }
|
||||||
{
|
If ( $FORCE ) { $INSTALL = $true }
|
||||||
|
If ( $INSTALL ) {
|
||||||
## Download agent and get path
|
## Download agent and get path
|
||||||
$AGENT_INSTALLER = Download-File -URL "http://emberkom.servicedesk.atera.com/GetAgent/Msi/?customerId=${CUSTOMER_ID}&integratorLogin=${INTEGRATOR_ID}" -File $AGENT_INSTALLER
|
$AGENT_INSTALLER = Download-File -URL "http://emberkom.servicedesk.atera.com/GetAgent/Msi/?customerId=${CUSTOMER_ID}&integratorLogin=${INTEGRATOR_ID}" -File $AGENT_INSTALLER
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user