PowerShell profiles

Reload PowerShell profile

. $profile

Category:

dev-setup

Tags:

powershellwindows

Share this article on:

PowerShell Core

The default location changed in PowerShell Core to

$homeDocumentsPowerShell

PowerShell

Profile locations

# executes automatically
$homeDocumentsWindowsPowerShellprofile.ps1

# executes with console host only
$homeDocumentsWindowsPowerShellMicrosoft.PowerShell_profile.ps1

# executes with ISE only
$homeDocumentsWindowsPowerShellMicrosoft.PowerShellISE_profile.ps1

# Visual Studio Package Manager Console
$homeDocumentsWindowsPowerShellNuGet_profile.ps1

When . $profile doesn’t quite cut it.

function Reload-Profile {
	@(
		$Profile.AllUsersAllHosts,
		$Profile.AllUsersCurrentHost,
		$Profile.CurrentUserAllHosts,
		$Profile.CurrentUserCurrentHost
	) | % {
		if (Test-Path $_) {
			Write-Verbose "Reloading $_"
			. $_
		}
	}
}

Updates

  • 4 September 2018: Updated locations for PowerShell Core