- September 23, 2016 at 5:33 pm #54551
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)
JoshSeptember 23, 2016 at 5:36 pm #54552
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.September 23, 2016 at 5:37 pm #54553
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.
You must be logged in to reply to this topic.