Getting Ready

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.

  1. Open a PowerShell console. (You could either run pwsh at the terminal or use the VS Code console. This recipe uses the terminal.)
  2. Reveal the path of your profile. To do this, simply call the automatic variable.
PS> $PROFILE
  1. Check if your profile exists.
PS> Test-Path $PROFILE
  1. 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
  1. 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
  1. We will now edit the profile in VS Code. At the terminal, type:
PS> code $PROFILE
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.25.32