You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i used Invoke-ps2exe with arguments, it failed with a message 'cmd-let Invoke-ps2exe not found ...'. Using only Invoke-ps2exe showed the help text correctly. I solved the problem adding an 'Import-Module ...; statement before the recursive 'Invoke-ps2exe' command inside of the function. This imports your module in the new started session and fixed my problem.
functionInvoke-ps2exe
{
...
if (!$nested-and ($PSVersionTable.PSEdition-eq"Core"))
{
...
$CallParam+=" -nested"$commandname=$($MyInvocation.MyCommand.Name)
$modulePath="$PSScriptRoot\ps2exe.psm1"$command="Import-Module '$modulePath'; & '$commandname' $CallParam"Write-Host"Executing new session: $command"# Execute the command in a new Windows PowerShell process
powershell -Command $commandreturn
...
Please check if this is a correct fix.
Thank you.
The text was updated successfully, but these errors were encountered:
as PS2EXE is made for Windows Powershell and not for Powershell Core, it was never my focus to get it running in a Core environment. But your approach seems to be a good idea.
Hi,
when i used Invoke-ps2exe with arguments, it failed with a message 'cmd-let Invoke-ps2exe not found ...'. Using only Invoke-ps2exe showed the help text correctly. I solved the problem adding an 'Import-Module ...; statement before the recursive 'Invoke-ps2exe' command inside of the function. This imports your module in the new started session and fixed my problem.
Please check if this is a correct fix.
Thank you.
The text was updated successfully, but these errors were encountered: