Double click ps1 file and powershell window disappears -
i checked here , there topics talking double clikc ps1 file run. situation have ps1 file opening remote session this:
$pw = convertto-securestring -asplaintext -force -string xxxxxx $cred = new-object -typename system.management.automation.pscredential -argumentlist "xxxx\admin",$pw $pc = read-host -prompt "please enter pc name" $session = new-pssession -computername $pc -credential $cred enter-pssession $session
and tried this way make double click run,
powershell.exe -command "& 'c:\a path spaces\myscript.ps1' -myarguments blah"
after entered pc name, console disappears....
any idea why?
did try -noexit option?
powershell.exe -noexit -command "& 'c:\a path spaces\myscript.ps1' -myarguments blah"
Comments
Post a Comment