One feature of PowerShell Studio that you want to pay attention to is the PowerShell Cache Editor. When PowerShell Studio is opened for the first time, it creates a cache of all available cmdlets and modules that are on your local machine. The cached cmdlets and modules are used to provide PrimalSense, syntax coloring for your PowerShell scripts, and are displayed in the Object Browser.
The module must be located in a PSModulePath directory in order to be discovered by the caching process. Use the following PowerShell one-liner(s) to display the content stored in the PSModulePath: “$env:PSModulePath“, or “$env:PSModulePath.Split(‘;’)“.
Because PowerShell Studio uses a cache of the modules, newly installed modules will not be displayed automatically in the Object Browser.
There are two ways you can update the cache:
This will open the “PowerShell Cache Editor“.
In order to load the new module(s) manually, follow these steps:
Now, the local cache has been updated with the module(s) you want to use in PowerShell Studio. Please notice that when you hover the mouse over the module name, the module version will be displayed.
At this point, the selected module is available under the Object Browser section and can be easily added using the following steps:
Notice, while working with the “PowerShell Cache Editor”, there’s no need to use the “Refresh Local Cache“.
Just remember, when having multiple versions of the same module, make sure to use the latest one.
Companion Video: PowerShell Studio: Cache Editor Feature