Deploying a PowerShell Profile?

Welcome Forums General PowerShell Q&A Deploying a PowerShell Profile?

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

 
Participant
4 years, 3 months ago.

  • Author
    Posts
  • #16682

    Participant
    Points: 0
    Rank: Member

    Hello, I was wondering if anyone knows of a good way to deploy a default PowerShell profile to a group of machines. I have tried to create a profile on a few remote machines using a PowerShell start up script through group policy. Unfortunately it seems that UAC is preventing this file from being created. The reason I would like to create a default profile is for a group of our technicians. In this profile I can point a network path for the modules and drop in some custom modules and functions that could save them some time while they are out in the field.

    Thanks for any help!

  • #16683

    Keymaster
    Points: 1
    Rank: Member

    There are four PowerShell profile scripts: Two for each host (console and ISE). For each host, one script is "current user" and the other is "all users."

    It should just be a file copy operation, especially the "all users" scripts, as they aren't in a user's home folder.

    However, that's not the right way to point a network path for modules. You should do that by modifying the PSModulePath environment variable in Windows – such as in a GPO. For example, modify it to include a UNC path for your network, and to include C:\Program Files\WindowsPowerShell\Modules (that is included already in v4+). Any custom local modules should be deployed to that Program Files location for offline availability – they don't need to go in a profile.

  • #16725

    Participant
    Points: 0
    Rank: Member

    Thank you very much! I will take a look at this. Trying to copy a default profile over to each machine via logon script was tending to produce results.

  • #16740

    Participant
    Points: 0
    Rank: Member

    Found a very easy way to do this through group policy.

    1. Open Group Policy Management
    2. Navigate to the desired Organizational Unit
    3. Create or edit the desired group policy
    4. Navigate to "User Configuration" -> "Preferences" -> "Windows Settings" -> "Environment"
    5. Right Click in the UI Area
    6. Set Action to : Update
    7. Select the "System Variable" radio button
    8. Set Value to your desired path (This can be a network path)

    Hope this helps some people in the future!

    Thanks!

The topic ‘Deploying a PowerShell Profile?’ is closed to new replies.