Update SVSTaskGate.ps1
This commit is contained in:
@@ -860,10 +860,21 @@ try {
|
||||
$bodyStream = New-Object IO.StreamReader $request.InputStream
|
||||
$body = $bodyStream.ReadToEnd()
|
||||
$selectedSite = ConvertFrom-Json $body
|
||||
Invoke-Expression $selectedSite.installRMMCommand
|
||||
|
||||
$installCommand = $selectedSite.installRMMCommand
|
||||
|
||||
$responseString = "RMM install triggered."
|
||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||
# Ensure API parameters are included
|
||||
$installCommand += " -ApiUrl '$ApiUrl' -ApiKey '$ApiKey' -ApiSecretKey '$ApiSecretKey'"
|
||||
|
||||
try {
|
||||
Invoke-Expression $installCommand
|
||||
$responseString = "RMM install triggered successfully."
|
||||
}
|
||||
catch {
|
||||
$responseString = "Error triggering RMM install: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||
$response.ContentType = "text/plain"
|
||||
$response.ContentLength64 = $buffer.Length
|
||||
$response.OutputStream.Write($buffer, 0, $buffer.Length)
|
||||
@@ -871,6 +882,7 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
"/setSVSPowerplan" {
|
||||
if ($request.HttpMethod -eq "GET") {
|
||||
Set-SVSPowerPlan
|
||||
|
||||
Reference in New Issue
Block a user