I want to have several (more than one) PowerShell profiles which will create different environments.
More specifically I need way for start separate PowerShell ISE for work with TFS and other PowerShell ISE instance for regular work. 'TFS' environment require loading some additional snappins, modules, modify prompt and so on. I do not want all this stuff will be executed for regular PowerShell ISE sessions but only when I want to.
I found that I can automatically load arbitrary script through command line parameter -File, but it does not executed automatically..
I do it by creating a shortcut for PowerShell ISE with a default directory :
In the default Directory (here called D:\TFS) I create a
.PS1
file calledlocal_profile.ps1
.In the beginning of the current profile file (
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
) I add :You just have to add your initialization code to
D:\TFS\local_profile.ps1
.