Shared Scripts (also known as PowerPack profiles) are another great feature introduced in PowerGUI 1.8.
If you ever wanted to have common functions available through-out your PowerPack or if you ever wanted to perform some kind of initialization before your PowerPack is used – this is exactly what you need.
From within any script node/link/action belonging to a PowerPack you can click Shared Scripts and edit the profile:
- This profile will be available to any scripted nodes, links or actions of the pack.
- The code will executed the first time any element of the PowerPack is clicked.
- This is a great place to store common functions, variables, or place your initialization code (e.g. connecting to Active Directory or virtualization infrastructure.)
When you export a PowerPack the Shared Scripts get exported with it.
If you want to include them with a centrally managed PowerGUI configuration, don’t forget to share the %appdata%\Quest Software\PowerGUI\Scripts folder in the same file share where you put the PowerGUI configuration file (by the way, renamed to config.xml).