Update samy.ps1

This commit is contained in:
2025-11-26 21:03:52 -05:00
parent 2a02b12e11
commit 0b54fee99d

View File

@@ -6,7 +6,7 @@
<# <#
.SYNOPSIS .SYNOPSIS
ScriptMonkey - MSP client onboarding/offboarding toolkit with a user interface, Script Automation Monkey - MSP client onboarding/offboarding toolkit with a user interface,
and optional silent install of the SVSMSP toolkit and headless DattoRMM deployment. and optional silent install of the SVSMSP toolkit and headless DattoRMM deployment.
.DESCRIPTION .DESCRIPTION
@@ -160,7 +160,7 @@ $ProgressPreference = 'SilentlyContinue'
$ConfirmPreference = 'None' $ConfirmPreference = 'None'
#endregion Safely bypass Restricted Execution Policy #endregion Safely bypass Restricted Execution Policy
function Invoke-ScriptMonkey { function Invoke-ScriptAutomationMonkey {
# ───────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────
# PARAMETERS + GLOBAL VARIABLES # PARAMETERS + GLOBAL VARIABLES
@@ -424,7 +424,7 @@ $ConfirmPreference = 'None'
.SYNOPSIS .SYNOPSIS
Standardized logging utility with console/file output and Windows Event Log support, Standardized logging utility with console/file output and Windows Event Log support,
including one-time event source initialization and optional auto-elevated creation including one-time event source initialization and optional auto-elevated creation
of a custom log/source. (Fallback implementation for ScriptMonkey.) of a custom log/source. (Fallback implementation for ScriptAutomationMonkey.)
.DESCRIPTION .DESCRIPTION
Mirrors the SVSMSP toolkit Write-Log so that Write-LogHybrid can safely fall back Mirrors the SVSMSP toolkit Write-Log so that Write-LogHybrid can safely fall back
@@ -1087,7 +1087,7 @@ function Get-UIHtml {
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Script Monkey</title> <title>Script Automation Monkey</title>
<link rel="icon" href="https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch/main/SVS_Favicon.ico"> <link rel="icon" href="https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch/main/SVS_Favicon.ico">
<style> <style>
@@ -1787,7 +1787,7 @@ function Install-DattoRMM {
} }
#endregion Dispatch-Request #endregion Dispatch-Request
#region EntryPoint: Define Invoke-ScriptMonkey #region EntryPoint: Define Invoke-ScriptAutomationMonkey
# ───────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────
# 3) MAIN LOGIC (Toolkit vs DattoFetch vs DattoInstall vs UI) # 3) MAIN LOGIC (Toolkit vs DattoFetch vs DattoInstall vs UI)
@@ -1850,11 +1850,11 @@ function Install-DattoRMM {
'UI' { 'UI' {
$url = "http://localhost:$Port/" $url = "http://localhost:$Port/"
Write-LogHybrid "Starting ScriptMonkey UI on $url" Info Startup Write-LogHybrid "Starting ScriptAutomationMonkey UI on $url" Info Startup
# Open the UI in a separate PowerShell job so Start-Server can block safely. # Open the UI in a separate PowerShell job so Start-Server can block safely.
try { try {
Start-Job -Name 'OpenScriptMonkeyUI' -ScriptBlock { Start-Job -Name 'OpenScriptAutomationMonkeyUI' -ScriptBlock {
param($u) param($u)
Start-Sleep -Milliseconds 300 Start-Sleep -Milliseconds 300
try { try {
@@ -1878,7 +1878,7 @@ function Install-DattoRMM {
'UI' { 'UI' {
$url = "http://localhost:$Port/" $url = "http://localhost:$Port/"
Write-LogHybrid "Starting ScriptMonkey UI on $url" Info Startup Write-LogHybrid "Starting ScriptAutomationMonkey UI on $url" Info Startup
# Resolve Edge path explicitly (x86 first, then 64-bit, then PATH) # Resolve Edge path explicitly (x86 first, then 64-bit, then PATH)
$edgeCandidates = @( $edgeCandidates = @(
@@ -1892,7 +1892,7 @@ function Install-DattoRMM {
} }
# Launch Edge (app mode) in a background job so Start-Server can block # Launch Edge (app mode) in a background job so Start-Server can block
Start-Job -Name 'OpenScriptMonkeyUI' -ScriptBlock { Start-Job -Name 'OpenScriptAutomationMonkeyUI' -ScriptBlock {
param([string]$u, [string]$edge) param([string]$u, [string]$edge)
Start-Sleep -Milliseconds 400 Start-Sleep -Milliseconds 400
try { try {
@@ -1912,7 +1912,7 @@ function Install-DattoRMM {
} }
#endregion EntryPoint: Define Invoke-ScriptMonkey #endregion EntryPoint: Define Invoke-ScriptAutomationMonkey
} }
@@ -1921,7 +1921,7 @@ function Install-DattoRMM {
# dot-sourced, don't invoke # dot-sourced, don't invoke
} elseif ($PSCommandPath) { } elseif ($PSCommandPath) {
# script was saved and run directly # script was saved and run directly
Invoke-ScriptMonkey @PSBoundParameters Invoke-ScriptAutomationMonkey @PSBoundParameters
} else { } else {
# iwr | iex fallback # iwr | iex fallback
if ($args.Count -gt 0) { if ($args.Count -gt 0) {
@@ -1939,9 +1939,9 @@ function Install-DattoRMM {
} }
} }
} }
Invoke-ScriptMonkey @namedArgs Invoke-ScriptAutomationMonkey @namedArgs
} else { } else {
Invoke-ScriptMonkey Invoke-ScriptAutomationMonkey
} }
} }