Understanding Present Working Directory $PWD 

VSCode 

VSCode sets the $PWD (“present working directory”) to the Workspace location

PowerShell ISE / CLI 

For the PowerShell ISE or PowerShell CLI you can set the $PWD in multiple ways Edit the Shortcut “Start in:” location variable to your desired path

Working with the $PWD within the Script 

Explain why you need this and what this is doing

1
2
3
# Creates new Profile ps1 
if (!(Test-Path -Path $PROFILE ))
{ New-Item -Type File -Path $PROFILE -Force }

Then explain how to use it using additional code

1
COde that calls the other paths or somethign

Setting $PWD in the $Profile 

Or you can edit your profile to include a “*Set-Location*” command put in a side note here about the different profiles, and what they do

1
2
# Uses PowerShell ISE to edit the profile
psedit $profile.CurrentUserCurrentHost

Additional Reading 

Using Profiles in the PowerShell_ISE

About_Profiles