Profile for VS Code / Powershell 1.9.0 extension / Powershell Core
- Sun, Dec 2 2018 at 7:48 pm #888064
I am beginning to use VS Code (in conjunction with Powershell 1.9.0 extension).
I also installed Powershell Core 6.1 — on the understanding (please correct if
this is wrong!) that VS Code will use Powershell Core 6.1 by default.
In Powershell ISE, I had a simple “Login script” file named:
which automatically runs a few lines of PS code such as Set-Location,
Set-RemoteExecutonPolicy, Get-content env:Psmodulepath, etc.. for my “environment”.
My question is:
Where would I put such a Login script in the VS Code/Powershell 1.9.0?
I notice that Vs Code created two separate folders in my Documents folder:
And what file name should I use?
Would be grateful for any advice, tips or references. Thanks in advance.
- Mon, Dec 3 2018 at 1:03 am #888182Luc FullenwarthModeratorMember Points: 16,126Rank: 4
- Mon, Dec 3 2018 at 3:34 am #888204
Much appreciated, Mr Fullenwarth.
- Mon, Dec 3 2018 at 2:54 am #888194Michael PietroforteKeymasterMember Points: 37,150Rank: 4
PowerShell ISE has its own profiles because it comes with an independent PowerShell host. On the other hand, Visual Code does not have its own host and can work with all PowerShell hosts that are available on your computer. I described in detail how PowerShell profiles work.
- Mon, Dec 3 2018 at 3:29 am #888200
- You must be logged in to reply to this topic.