How to reload user profile from script file in PowerShell

后端 未结 8 569
情深已故
情深已故 2020-12-29 01:02

I want to reload my user profile from a script file. I thought that dot sourcing it from within the script file would do the trick, but it doesn\'t work:

# f         


        
8条回答
  •  天命终不由人
    2020-12-29 01:54

    since I stumbled onto this several years later, I thought to add that you can use the invocation operator: & to load your profile with the default variable to your profile: $profile.

    so, if your session somehow fails to load your profile (happens to me with cmder/conemu) just type:

    & $profile

提交回复
热议问题