diff --git a/SVSTaskGate.ps1 b/SVSTaskGate.ps1 index 4fbc098..7775a93 100644 --- a/SVSTaskGate.ps1 +++ b/SVSTaskGate.ps1 @@ -701,7 +701,13 @@ function GetHtmlContent { const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value); - let installRMMCommand = 'Install-DattoRMM -ApiUrl $ApiUrl -ApiKey $ApiKey -ApiSecretKey $ApiSecretKey'; + // Predefined PowerShell global variables passed into JavaScript + const ApiUrl = "$global:ApiUrl"; + const ApiKey = "$global:ApiKey"; + const ApiSecretKey = "$global:ApiSecretKey"; + + let installRMMCommand = `Install-DattoRMM -ApiUrl '${ApiUrl}' -ApiKey '${ApiKey}' -ApiSecretKey '${ApiSecretKey}'`; + if (checkedValues.includes('inputVar')) { installRMMCommand += ' -PushSiteVars';