From d18764a0e717a81de6cdcfe37fc2e87d31ee15b1 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 22 Jun 2025 16:02:34 -0400 Subject: [PATCH] Update StackMonkey.ps1 --- StackMonkey.ps1 | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/StackMonkey.ps1 b/StackMonkey.ps1 index 14a05ed..ce6e8dc 100644 --- a/StackMonkey.ps1 +++ b/StackMonkey.ps1 @@ -3,6 +3,26 @@ #endregion +#region ScriptMonkey Entrypoint + +[CmdletBinding()] +param( + [switch]$SilentInstall +) + +# If the user asked for a silent install, do just that and quit +if ($SilentInstall) { + Write-LogHelper -Message "Silent install requested" -Level Info -TaskCategory "Startup" + Install-SVSMSP -InstallToolkit + return +} + +## To use the silent install of the SVSMSP module +## & ([ScriptBlock]::Create( (iwr 'sm.svstools.ca').Content )) -SilentInstall + +#endregion + + # STACK = Scripted Tooling for Automated Client Kickoff # MONKEY = Module-based Onboarding & Next-step Kickoff Engine Yoke # Conveys the idea of coupling tasks together and keeping them under control. @@ -1232,8 +1252,11 @@ function Start-Server { #endregion -# open browser on whatever port you've set -Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:$Port" - -# now start your server (this will block until you hit Exit in the UI) -Start-Server +# Only launch UI if not in silent mode +if (-not $SilentInstall) { + # open browser on whatever port you've set + Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:$Port" + # now start your server (this will block until you hit Exit in the UI) + Start-Server +} +#endregion