Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 54
    $profile is an automatic variable that points at your user profile for all PowerShell hosts. Commented Apr 3, 2009 at 22:31
  • 16
    Note that (split-path $profile)(to get the containing folder) can contain multiple profile files: profile.ps1 should be loaded by all hosts, <host-name>_profile.ps1 just by the specified host. For PowerShell.exe (console host), this is Microsoft.PowerShell_profile.ps1. Commented Apr 4, 2009 at 14:44
  • 17
    What if I don't have a folder WindowsPowerShell in my documents? Should I create the folder and the file? What should I put in the file if I want to add C:\path\to\file.ext to the environment variables? EDIT: found it already. Answer is yes, create it. The file should consist of 1 line: $env:path += ;C:\path\to\file.ext". Commented Mar 11, 2015 at 10:34
  • 10
    @Lewistrick You don't have a profile by default. I followed these instructions to create one: howtogeek.com/50236/customizing-your-powershell-profile Commented Oct 13, 2015 at 0:45
  • 20
    Be careful doing this -- it will clobber your existing path. $env:Path = "SomeRandomPath"; Instead - see @mloskot, below. Commented Nov 24, 2015 at 0:16