Launch function in new Powershell window This topic contains 4 replies, has 3 voices, and was last updated by Alex 2 weeks, 1 day ago. Author Posts June 28, 2018 at 6:54 pm #103547 AlexParticipant Hello, Just wondering as to how I can get the following accomplished. I have a $profile that consist of functions. The functions are that of PSSessions to our messaging environments What I would like is to be able to type in the pre-loaded function say for PSSession to Exchange and have it launch in a Powershell window so that I can have separate windows. Currently I am having to open individual PS instances and running the function depending on what I want to establish connection to. Any help would be appreciated. Thanks in advance Alex June 28, 2018 at 7:07 pm #103550 Don JonesKeymaster That will be tricky. You'll need to have your script run PowerShell.exe to start a new process, and pass a command line switch to have the new process run whatever it is you want running in the new window. PowerShell isn't a multi-window application like Word; each window is a fresh standalone process. June 28, 2018 at 8:11 pm #103558 AlexParticipant Wow, Wasn't expecting an answer from the Powershell Legend himself. I will research further but I'm guessing the command line switch will be some sort of bat file to execute the commands? Possibly not in the form of a function but instead a .ps1 file. Thanks Don! June 29, 2018 at 1:39 pm #103585 David SchmidtbergerParticipant here is a snippet that i use (i need this script to be called from a parent script to execute a process that needs to run as a seperate user instance) #script must contain fqdn path to ps1 file $script = "" $commandLine = "-noexit & $script" $credential = Get-Credential Start-Process powershell.exe -Credential $credential -ArgumentList $commandline July 4, 2018 at 8:43 am #103876 AlexParticipant Appreciate the feedback and guidance @david Author Posts You must be logged in to reply to this topic.