diff --git a/src/bootsupport/modules/punk-0.1.tm b/src/bootsupport/modules/punk-0.1.tm index 83dad2bf..f6b5aa6a 100644 --- a/src/bootsupport/modules/punk-0.1.tm +++ b/src/bootsupport/modules/punk-0.1.tm @@ -8272,12 +8272,14 @@ namespace eval punk { #todo - powershell detection on other platforms set has_powershell 0 } + + #todo - distinguish non-preinstalled pwsh (powershell core) from powershell which is available by default if {$has_powershell} { #see also powershell runspaces etc: # powershell runspaces e.g $rs=[RunspaceFactory]::CreateRunspace() # $ps = [Powershell]::Create() - interp alias {} ps {} exec >@stdout pwsh -nolo -nop -c + interp alias {} pse {} exec >@stdout pwsh -nolo -nop -c interp alias {} psx {} runx -n pwsh -nop -nolo -c interp alias {} psr {} run -n pwsh -nop -nolo -c interp alias {} psout {} runout -n pwsh -nop -nolo -c @@ -8285,8 +8287,8 @@ namespace eval punk { interp alias {} psls {} shellrun::runconsole pwsh -nop -nolo -c ls interp alias {} psps {} shellrun::runconsole pwsh -nop -nolo -c ps } else { - set ps_missing "powershell missing (powershell is open source and can be installed on windows and most unix-like platforms)" - interp alias {} ps {} puts stderr $ps_missing + set ps_missing "powershell missing (powershell is MIT licensed open source and can be installed on windows and most unix-like platforms)" + interp alias {} pse {} puts stderr $ps_missing interp alias {} psx {} puts stderr $ps_missing interp alias {} psr {} puts stderr $ps_missing interp alias {} psout {} puts stderr $ps_missing diff --git a/src/modules/punk-0.1.tm b/src/modules/punk-0.1.tm index 83dad2bf..f6b5aa6a 100644 --- a/src/modules/punk-0.1.tm +++ b/src/modules/punk-0.1.tm @@ -8272,12 +8272,14 @@ namespace eval punk { #todo - powershell detection on other platforms set has_powershell 0 } + + #todo - distinguish non-preinstalled pwsh (powershell core) from powershell which is available by default if {$has_powershell} { #see also powershell runspaces etc: # powershell runspaces e.g $rs=[RunspaceFactory]::CreateRunspace() # $ps = [Powershell]::Create() - interp alias {} ps {} exec >@stdout pwsh -nolo -nop -c + interp alias {} pse {} exec >@stdout pwsh -nolo -nop -c interp alias {} psx {} runx -n pwsh -nop -nolo -c interp alias {} psr {} run -n pwsh -nop -nolo -c interp alias {} psout {} runout -n pwsh -nop -nolo -c @@ -8285,8 +8287,8 @@ namespace eval punk { interp alias {} psls {} shellrun::runconsole pwsh -nop -nolo -c ls interp alias {} psps {} shellrun::runconsole pwsh -nop -nolo -c ps } else { - set ps_missing "powershell missing (powershell is open source and can be installed on windows and most unix-like platforms)" - interp alias {} ps {} puts stderr $ps_missing + set ps_missing "powershell missing (powershell is MIT licensed open source and can be installed on windows and most unix-like platforms)" + interp alias {} pse {} puts stderr $ps_missing interp alias {} psx {} puts stderr $ps_missing interp alias {} psr {} puts stderr $ps_missing interp alias {} psout {} puts stderr $ps_missing diff --git a/src/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd b/src/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd index 8fb75ca3..835c84e4 100644 --- a/src/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd +++ b/src/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd @@ -800,7 +800,12 @@ if ($matches.count) { if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { # If not elevated, relaunch with elevated privileges # -Wait e.g for starting a service or other operations which remainder of script may depend on - Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile -NoExit -ExecutionPolicy Bypass -File $($MyInvocation.MyCommand.Path)" -Wait -Verb RunAs + $arguments = @("-NoProfile", "-NoExit", "-ExecutionPolicy", "Bypass") + $arguments += @("-File", $($MyInvocation.MyCommand.Path)) + $arguments += $args + + #Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile -NoExit -ExecutionPolicy Bypass -File $($MyInvocation.MyCommand.Path)" -Wait -Verb RunAs + Start-Process -FilePath "pwsh.exe" -ArgumentList $arguments -Wait -Verb RunAs Exit # Exit the current non-elevated process } } diff --git a/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm b/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm index 83dad2bf..f6b5aa6a 100644 --- a/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm +++ b/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm @@ -8272,12 +8272,14 @@ namespace eval punk { #todo - powershell detection on other platforms set has_powershell 0 } + + #todo - distinguish non-preinstalled pwsh (powershell core) from powershell which is available by default if {$has_powershell} { #see also powershell runspaces etc: # powershell runspaces e.g $rs=[RunspaceFactory]::CreateRunspace() # $ps = [Powershell]::Create() - interp alias {} ps {} exec >@stdout pwsh -nolo -nop -c + interp alias {} pse {} exec >@stdout pwsh -nolo -nop -c interp alias {} psx {} runx -n pwsh -nop -nolo -c interp alias {} psr {} run -n pwsh -nop -nolo -c interp alias {} psout {} runout -n pwsh -nop -nolo -c @@ -8285,8 +8287,8 @@ namespace eval punk { interp alias {} psls {} shellrun::runconsole pwsh -nop -nolo -c ls interp alias {} psps {} shellrun::runconsole pwsh -nop -nolo -c ps } else { - set ps_missing "powershell missing (powershell is open source and can be installed on windows and most unix-like platforms)" - interp alias {} ps {} puts stderr $ps_missing + set ps_missing "powershell missing (powershell is MIT licensed open source and can be installed on windows and most unix-like platforms)" + interp alias {} pse {} puts stderr $ps_missing interp alias {} psx {} puts stderr $ps_missing interp alias {} psr {} puts stderr $ps_missing interp alias {} psout {} puts stderr $ps_missing diff --git a/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk-0.1.tm b/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk-0.1.tm index 83dad2bf..f6b5aa6a 100644 --- a/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk-0.1.tm +++ b/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk-0.1.tm @@ -8272,12 +8272,14 @@ namespace eval punk { #todo - powershell detection on other platforms set has_powershell 0 } + + #todo - distinguish non-preinstalled pwsh (powershell core) from powershell which is available by default if {$has_powershell} { #see also powershell runspaces etc: # powershell runspaces e.g $rs=[RunspaceFactory]::CreateRunspace() # $ps = [Powershell]::Create() - interp alias {} ps {} exec >@stdout pwsh -nolo -nop -c + interp alias {} pse {} exec >@stdout pwsh -nolo -nop -c interp alias {} psx {} runx -n pwsh -nop -nolo -c interp alias {} psr {} run -n pwsh -nop -nolo -c interp alias {} psout {} runout -n pwsh -nop -nolo -c @@ -8285,8 +8287,8 @@ namespace eval punk { interp alias {} psls {} shellrun::runconsole pwsh -nop -nolo -c ls interp alias {} psps {} shellrun::runconsole pwsh -nop -nolo -c ps } else { - set ps_missing "powershell missing (powershell is open source and can be installed on windows and most unix-like platforms)" - interp alias {} ps {} puts stderr $ps_missing + set ps_missing "powershell missing (powershell is MIT licensed open source and can be installed on windows and most unix-like platforms)" + interp alias {} pse {} puts stderr $ps_missing interp alias {} psx {} puts stderr $ps_missing interp alias {} psr {} puts stderr $ps_missing interp alias {} psout {} puts stderr $ps_missing diff --git a/src/vfs/_vfscommon.vfs/modules/punk-0.1.tm b/src/vfs/_vfscommon.vfs/modules/punk-0.1.tm index 83dad2bf..f6b5aa6a 100644 --- a/src/vfs/_vfscommon.vfs/modules/punk-0.1.tm +++ b/src/vfs/_vfscommon.vfs/modules/punk-0.1.tm @@ -8272,12 +8272,14 @@ namespace eval punk { #todo - powershell detection on other platforms set has_powershell 0 } + + #todo - distinguish non-preinstalled pwsh (powershell core) from powershell which is available by default if {$has_powershell} { #see also powershell runspaces etc: # powershell runspaces e.g $rs=[RunspaceFactory]::CreateRunspace() # $ps = [Powershell]::Create() - interp alias {} ps {} exec >@stdout pwsh -nolo -nop -c + interp alias {} pse {} exec >@stdout pwsh -nolo -nop -c interp alias {} psx {} runx -n pwsh -nop -nolo -c interp alias {} psr {} run -n pwsh -nop -nolo -c interp alias {} psout {} runout -n pwsh -nop -nolo -c @@ -8285,8 +8287,8 @@ namespace eval punk { interp alias {} psls {} shellrun::runconsole pwsh -nop -nolo -c ls interp alias {} psps {} shellrun::runconsole pwsh -nop -nolo -c ps } else { - set ps_missing "powershell missing (powershell is open source and can be installed on windows and most unix-like platforms)" - interp alias {} ps {} puts stderr $ps_missing + set ps_missing "powershell missing (powershell is MIT licensed open source and can be installed on windows and most unix-like platforms)" + interp alias {} pse {} puts stderr $ps_missing interp alias {} psx {} puts stderr $ps_missing interp alias {} psr {} puts stderr $ps_missing interp alias {} psout {} puts stderr $ps_missing diff --git a/src/vfs/_vfscommon.vfs/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd b/src/vfs/_vfscommon.vfs/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd index 8fb75ca3..835c84e4 100644 --- a/src/vfs/_vfscommon.vfs/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd +++ b/src/vfs/_vfscommon.vfs/modules/punk/mix/templates/utility/scriptappwrappers/multishell.cmd @@ -800,7 +800,12 @@ if ($matches.count) { if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { # If not elevated, relaunch with elevated privileges # -Wait e.g for starting a service or other operations which remainder of script may depend on - Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile -NoExit -ExecutionPolicy Bypass -File $($MyInvocation.MyCommand.Path)" -Wait -Verb RunAs + $arguments = @("-NoProfile", "-NoExit", "-ExecutionPolicy", "Bypass") + $arguments += @("-File", $($MyInvocation.MyCommand.Path)) + $arguments += $args + + #Start-Process -FilePath "pwsh.exe" -ArgumentList "-NoProfile -NoExit -ExecutionPolicy Bypass -File $($MyInvocation.MyCommand.Path)" -Wait -Verb RunAs + Start-Process -FilePath "pwsh.exe" -ArgumentList $arguments -Wait -Verb RunAs Exit # Exit the current non-elevated process } }