PowerShell Not your Father’s Command Line Part 9 of 31: Another Side of PowerShell Profiles

PowerShell profiles are a great way to load frequently used custom functions, variables, aliases, modules, and PowerShell objects every time you start PowerShell. Today, Matt will talked about how to setup your profile and some of the things you might put in your profile.

Matt mentions that there are 4 profiles – these are for the console. I qualify it at the console, as there are other profile variables that we’ll cover when we talk about the ISE later in the series. The 4 profiles though that he’s referring to can be edited following Matt’s guide and replacing $profile in his examples with any of the ones listed below:

  • $Profile, $Profile.CurrentUserCurrentHost
  • $Profile.CurrentUserAllHosts
  • $Profile.AllUsersCurrentHost
  • $Profile.AllUsersAllHosts

One other thing to note… Matt talks about creating a new profile with the -force option. However, you may have a profile in place already and may not want to overwrite it. If you want to see if the profile exists, use the Test-Path cmdlet:

Test-Path $profile

If the profile exists, then this will return True. Otherwise, it will return False.

As always, if you have any feedback for us, please send it along. We’ll hear what you have to say and may blog about a topic or suggestion!

One thought on “PowerShell Not your Father’s Command Line Part 9 of 31: Another Side of PowerShell Profiles

Leave a Reply

Your email address will not be published. Required fields are marked *