PowerTip: Use PowerShell to Show Path to All Your Profiles

PowerTip: Use PowerShell to Show Path to All Your Profiles

  • Comments 4
  • Likes

Summary: Use Windows PowerShell to show the path to all your Windows PowerShell profiles.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see the path to all of my Windows PowerShell profiles—
          not only the current host or current user profile?

Hey, Scripting Guy! Answer Use the $profile automatic variable, pipe the results to the Format-List cmdlet,
          and then use the –force parameter to force it to show all paths:

$PROFILE | Format-List -Force

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • It's strange that -Force is necessary. The help for that parameter says: PS C:\> Get-Help Format-List -Parameter Force -Force [] Directs the cmdlet to display all of the error information. Use with the DisplayError or ShowError parameters. By default, when an error object is written to the error or display streams, only some of the error information is displayed. Are the extra paths being treated as "error information" (and if so, why)? Or is this help is incomplete, I wonder.

  • (Hmm... the blog platform removed my carriage returns and has no edit option. Sorry for the mash of text up there.)

  • Can also use $profile | select * to find all the profile path.

  • Can be used as required ($profile).CurrentUserAllHosts ($profile).AllUsersAllHosts ($profile).AllUsersCurrentHost