Skip to content

Instantly share code, notes, and snippets.

@nilsandrey
Created June 25, 2024 15:02
Show Gist options
  • Save nilsandrey/cc06b9942ff8485016d12846690e052e to your computer and use it in GitHub Desktop.
Save nilsandrey/cc06b9942ff8485016d12846690e052e to your computer and use it in GitHub Desktop.
Reload your Powershell profile, credits to <https://stackoverflow.com/a/5501909/2100126>.
function Reload-Profile {
@(
$Profile.AllUsersAllHosts,
$Profile.AllUsersCurrentHost,
$Profile.CurrentUserAllHosts,
$Profile.CurrentUserCurrentHost
) | % {
if(Test-Path $_){
Write-Verbose "Running $_"
. $_
}
}
}
@nilsandrey
Copy link
Author

Add this function to your Powershell profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment