Update StackMonkey_Beta.ps1
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#region changes to be done
|
||||
|
||||
<#
|
||||
# seems like the command IS running without UI
|
||||
# & ([ScriptBlock]::Create( (iwr 'https://sm.svstools.com').Content )) -N8nPassword 'Tndmeeisdwge!' -FetchSitesOnly
|
||||
|
||||
& ([ScriptBlock]::Create((iwr 'https://sm.svstools.com' -UseBasicParsing).Content )) -N8nPassword 'pwd' -SiteUID '' -SiteName '' -InstallRMM -PushSiteVars -SaveCopy
|
||||
Need to pass the N8N variables to the "install-dattormm" in the toolkit
|
||||
# and iwr sm.svstools.com | iex lauched the UI as intended
|
||||
|
||||
#>
|
||||
# need to test
|
||||
|
||||
# Write-Host "🛠️ SAMY - Script Automation Monkey (Yeah!)" -ForegroundColor Cyan
|
||||
|
||||
#endregion changes to be done
|
||||
|
||||
@@ -427,6 +429,8 @@ $subHtml
|
||||
|
||||
#endregion Build-Checkboxes
|
||||
|
||||
#region Get-ModuleVersionHtml
|
||||
|
||||
### Get SVSMSP module version to display in the UI
|
||||
function Get-ModuleVersionHtml {
|
||||
$mod = Get-Module -ListAvailable -Name SVSMSP | Sort-Object Version -Descending | Select-Object -First 1
|
||||
@@ -436,6 +440,9 @@ $subHtml
|
||||
return "<div style='color:#f66;'>SVSMSP_Module not found</div>"
|
||||
}
|
||||
|
||||
#endregion Get-ModuleVersionHtml
|
||||
|
||||
#region Strat-Server
|
||||
# Starts the HTTP listener loop
|
||||
function Start-Server {
|
||||
# make it accessible to Dispatch-Request
|
||||
@@ -459,6 +466,7 @@ $subHtml
|
||||
Write-LogHybrid "Listener closed." "Info" "Server"
|
||||
}
|
||||
}
|
||||
#endregion Strat-Server
|
||||
|
||||
#region UIHtml
|
||||
function Get-UIHtml {
|
||||
@@ -1348,6 +1356,8 @@ $script
|
||||
|
||||
#endregion Handler Stubs
|
||||
|
||||
#region Dispatch-Request
|
||||
|
||||
# Sends the HTML for a given page or invokes a task handler
|
||||
function Dispatch-Request {
|
||||
param($Context)
|
||||
@@ -1389,6 +1399,7 @@ $script
|
||||
$Context.Response.StatusCode = 404
|
||||
Respond-Text $Context '404 - Not Found'
|
||||
}
|
||||
#endregion Dispatch-Request
|
||||
|
||||
#region EntryPoint: Define Invoke-ScriptMonkey
|
||||
|
||||
@@ -1474,9 +1485,6 @@ $script
|
||||
}
|
||||
#endregion EntryPoint: Define Invoke-ScriptMonkey
|
||||
|
||||
Write-Host "🛠️ SAMY - Script Automation Monkey (Yeah!)" -ForegroundColor Cyan
|
||||
Write-Host "ParameterSetName: $($PSCmdlet.ParameterSetName)" -ForegroundColor Yellow
|
||||
|
||||
#region — guarantee NuGet provider is present without prompting
|
||||
|
||||
# ─── Top of script ───
|
||||
@@ -1524,10 +1532,6 @@ $script
|
||||
|
||||
#endregion
|
||||
|
||||
# If we got here, it's the UI set—launch browser + listener:
|
||||
# ——— UI fallback starts here ———
|
||||
Write-LogHybrid "Launching UI" Info Startup
|
||||
|
||||
#region Install-DattoRMM-Helper
|
||||
function Install-DattoRMM-Helper {
|
||||
param (
|
||||
|
||||
Reference in New Issue
Block a user