Deploy Custom PowerShell Modules to an Enterprise

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #54551
    Profile photo of Josh Wright
    Josh Wright
    Participant

    Hi,

    We are looking to start using a number of various Custom PowerShell Modules in our business, some of which will be using during PS Remoting.

    For this reason, I thought that it would be more efficient and convenient to have these custom modules deployed to "C:\Program Files\WindowsPowerShell\Modules" for quick use during Invoke-command and PS Remoting sessions.

    I know that this can be easily achieved via Group Policy and the Replace File option or similar, but I don't think that this would be very efficient

    The other option would be to possibly use a logon script to check if the files differ and update them – again, I wasn't sure if this would be practical.

    Does anyone have any suggestions how we can deploy Custom PowerShell Modules centrally and keep them up-to-date in a timely manner with minimal administrative overhead?

    My guess is that in the early days, we might update them to LIVE a couple times a week or month it would be great to barley worry about them and still have consistent functionality on each machine.

    Any suggestions are greatly appreciated (my best is a logon script that checks to see if the modules have been modified)

    Kind regards

    Josh

    #54552
    Profile photo of Don Jones
    Don Jones
    Keymaster

    The best approach would be to ensure you've deployed PowerShell Package Manager and PowerShellGet, and then set up a private PowerShell Gallery. Nodes can then use Install-Module and Update-Module (which can be run whenever you feel it's needed) to pull modules down from your gallery. For example, scripts might proactively check for their dependencies as a first step, pull down whatever is needed, etc.

    Obviously, DSC is another way to declare which modules a node should have, and to ensure they have the latest version.

    #54553
    Profile photo of Don Jones
    Don Jones
    Keymaster

    But to more strongly make a point – I don't think logon scripts are a good approach. You'll be forever maintaining that script. Each script should check its own dependencies, which becomes a way of documenting, in the script, which modules the script depends on.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.