PowerShell by default does not create a profile during installation. It simply runs with its default configuration. Any override to this configuration would require creating and modifying the profile.
- Open a PowerShell console. (You could either run pwsh at the terminal or use the VS Code console. This recipe uses the terminal.)
- Reveal the path of your profile. To do this, simply call the automatic variable.
PS> $PROFILE
- Check if your profile exists.
PS> Test-Path $PROFILE
- If you get True as the response, you can proceed with the recipe. If the response is False, which is most likely the case, run the following:
PS> New-Item $PROFILE -ItemType File
- You may receive an error, saying a part of the path was not found. This is because your ~/.config/ directory does not by default contain a powershell directory. Adding -Force to the command creates this directory and creates your profile file at the location.
PS> New-Item $PROFILE -ItemType File -Force
- We will now edit the profile in VS Code. At the terminal, type:
PS> code $PROFILE