From 07fbc4b094c2f3a0050fedacb682c5272f57ff9c Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 5 Jan 2025 01:55:21 -0500 Subject: [PATCH] Update SVSTaskGate.ps1 --- SVSTaskGate.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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';