Powershell: Profile

A Powershell profile is a script file that is executed each time a new Powershell is opened.

The location and names must match certain rules, but other than that, it’s just a simple *.ps1 file with code in it…

Profile Type Profile Powershell-Path Example Filesystem Location
Current user & current Host $PROFILE.CurrentUserCurrentHost, or $PROFILE $Home\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Current user & ISE $Home\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
Current user & all hosts $PROFILE.CurrentUserAllHosts $Home\Documents\WindowsPowerShell\profile.ps1
All users & current Host $PROFILE.AllUsersCurrentHost $PSHome\Microsoft.PowerShell_profile.ps1
All users & ISE $PSHome\Microsoft.PowerShellISE_profile.ps1
All users & all hosts $PROFILE.AllUsersAllHosts $PSHome\profile.ps1

Reference: https://bitbucket.org/saoe/misc_public/src/master/powershell/Profile.ps1