Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

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.

PS2017 OB Cache 03 2017 11 08 17 10 01

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(‘;’)“.

PSmodulePath 01 2017 11 20 13 08 30

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:

  1. Refresh Cache – Refresh the cache using the  button via the Ribbon->Home->Platform->Refresh Cache.

PS2017 RefreshCache 2017 11 08 23 34 13

  1. Or use the PowerShell Cache Editor  – to modify and update the existing cache, which can be found via the Ribbon->File->Home->Platform->Edit Cache icon.

EditCache ICO 2017 11 08 18 19 43

This will open the “PowerShell Cache Editor“.

PSCacheEditor 2017 11 08 18 31 54

Using the Cache Editor to manually add or update a module

In order to load the new module(s) manually, follow these steps:

  1. Open the “PowerShell Cache Editor“.
  2. For example, look at the SQLPS module which has two versions installed:
    Cache SQLPS 01 2017 11 08 19 18 55
  3. Uncheck the older version – 1.0, then check the newer version (14.0).
  4. To update the Object Browser with the changes, click on the “Build Cache“, and “Close” the editor.
    Cache SQLPS 02 2017 11 08 19 18 55

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.

PS2017 OB Cache 02 2017 11 08 17 10 01

At this point, the selected module is available under the Object Browser section and can be easily added using the following steps:

  1. By drag-drop from the Object Browser.
    PS2017 OB DragDrop 2017 11 08 23 13 40
  2. Or, by just typing the command and the PrimalSense will response with a list of commands to choose.
    PS2017 TypingCommand 2017 11 08 23 16 59

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.

If you have questions about our products, please post in our support forum.
For licensed customers, use the forum associated with your product in our Product Support Forums for Registered Customers.
For users of trial versions, please post in our Former and Future Customers - Questions forum.
Copyright © 2024 SAPIEN Technologies, Inc.