July 29th, 2013

PowerTip: Reload Your PowerShell Profile

Doctor Scripto
Scripter

Summary: Reload your Windows PowerShell profile without closing and reopening Windows PowerShell.

Hey, Scripting Guy! Question How can I reload my Windows PowerShell profile to test some changes I made—without closing and reopening Windows PowerShell?

Hey, Scripting Guy! Answer Use the invocation operator with the automatic $profile variable:

& $profile

Note  Depending on how you have written your profile, you may generate a large number of errors, for example, Drive already exists or Alias already exists.

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • Zihao Xu

    The command ” & $profile ” doesn’t work on my computer.
    Luckily, I tried dot source, that is, ” . $profile ” and worked.