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.
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.
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.