Windows – Duplicate current powershell session in a new window

powershellwindows

Is it possible to duplicate a powershell session in a new window? I often find that I've created environment variables, activated a specific python virtualenvironment, defined one-off functions, custom prompt, etc. and it would be handy to duplicate those specific, one-off details of the current session into another session in another window.

Best Answer

You should use Powershell profile. In the profile you can have all of those functions, variables etc. Basically every time you open a powershell window, you can load your custom powershell profile which in turn will also load your settings as defined. Please see this link: Powershell profile.