Utilizing the Windows Powershell Script Folder

Welcome Forums General PowerShell Q&A Utilizing the Windows Powershell Script Folder

This topic contains 3 replies, has 4 voices, and was last updated by

1 year, 6 months ago.

  • Author
  • #80068

    Points: 3
    Rank: Member


    I am writing a script that I would like to call from a central location. I saw that Powershell has a Script folder. How can I utilize this folder so that any user can use this script in the console? TIA

  • #80069

    Points: 0
    Rank: Member

    I'm unsure as to what you are referring but,
    I'm guessing it is $PSScriptRoot. This refers to the folder from where you run the script.

    You could go about it different ways but if you were to store the scripts in a Folder where you set NTFS-security on (and share it). It should be available to everyone (within your security parameters).

    You could also include it in the powershell profile. But that gets dirty quite quickly in my opinion.

  • #80075

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    PowerShell doesn't have a central folder where it looks for scripts.

  • #80159

    Points: 0
    Rank: Member

    You can do something like dot sourcing your scripts folder in your powershell profile. If your scripts are not local you will need to digitally sign them or decrease the executionpolicy from remotesigned to unrestricted(BAD)!!



The topic ‘Utilizing the Windows Powershell Script Folder’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort