What’s the purpose of “Documents\PowerShell\Scripts” folder?

Welcome Forums General PowerShell Q&A What’s the purpose of “Documents\PowerShell\Scripts” folder?

Viewing 2 reply threads
  • Author
    Posts
    • #269678
      Participant
      Topics: 2
      Replies: 5
      Points: 55
      Rank: Member

      There is a folder in:

      C:\Users\USERNAME\Documents\PowerShell\Scripts

       

      I recall I’ve read somewhere this location is used as default to install scripts, same thing as PSModulePath but for scripts.

      I’m having really hard time to figure out which environment variable is used to update this folder?

      $env:Path += some_location, should work but I have some feeling this default location is to be used somehow else.

       

      Anyway if I put some scripts into this location it’s not picked up by new session, so my real question here is what’s the purpose of this folder?

    • #269705
      Participant
      Topics: 9
      Replies: 676
      Points: 2,674
      Helping Hand
      Rank: Community Hero

      The path with just PowerShell is for powershell core. The scripts folder is where scripts are installed when using Install-Script

      The path for Windows Powershell scripts is \user\documents\WindowsPowershell\Scripts

    • #269786
      Participant
      Topics: 2
      Replies: 5
      Points: 55
      Rank: Member

      I see, but why isn’t this location in session’s path by default if it’s used as default location to install scripts?

      Modules when installed are put into module path, what’s wrong with scripts then?

       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.