From 790c2491d05365fcf938b1a050dae00168628eee Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 29 Jun 2025 13:36:19 -0400 Subject: [PATCH] test 1 --- StackMonkey.ps1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/StackMonkey.ps1 b/StackMonkey.ps1 index fbfcef7..6f4cfc7 100644 --- a/StackMonkey.ps1 +++ b/StackMonkey.ps1 @@ -88,7 +88,8 @@ # 1) ENTRYPOINT + PARAMETER DECLARATION # ───────────────────────────────────────────────────────────────────────── - + function Invoke-ScriptMonkey { + [CmdletBinding( DefaultParameterSetName='UI', SupportsShouldProcess=$true, @@ -1564,4 +1565,16 @@ $script } #endregion ScriptMonkey run silently Entrypoint + } + + if ($MyInvocation.InvocationName -eq '.') { + # dot-sourced, don't invoke +} elseif ($PSCommandPath) { + # script was saved and run directly + Invoke-ScriptMonkey @PSBoundParameters +} else { + # iwr | iex fallback + Invoke-ScriptMonkey +} +