This commit is contained in:
2025-06-29 13:36:19 -04:00
parent a7e65c2b41
commit 790c2491d0

View File

@@ -88,7 +88,8 @@
# 1) ENTRYPOINT + PARAMETER DECLARATION # 1) ENTRYPOINT + PARAMETER DECLARATION
# ───────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────
function Invoke-ScriptMonkey {
[CmdletBinding( [CmdletBinding(
DefaultParameterSetName='UI', DefaultParameterSetName='UI',
SupportsShouldProcess=$true, SupportsShouldProcess=$true,
@@ -1564,4 +1565,16 @@ $script
} }
#endregion ScriptMonkey run silently Entrypoint #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
}