The features discussed in this article are available with PrimalScript 8.1.200 PowerShell Studio 5.8.238.
When PowerShell 3.0 was released, one of its most lauded features was updateable help. You could run Update-Help, and PowerShell would update the locally stored help files. Each module used to have a help URI in its definition files to update help. In addition, each help topic usually had a link to an online location where you could get up-to-date information in case the local help file lacked the latest developments.
You can easily argue about the presentation of help in a console, the lack of a search feature, and so forth—but the fact that help was stored locally was a definite advantage. Back then, internet connectivity was still sketchy in some places, and some serious lag times could interrupt your time “in the zone”.
I don’t know exactly when it started, but with the advent of some large modules—like Microsoft.Graph or Azure—the local help files disappeared from many modules.
Not only is the file missing, there is no URI to download it. Instead, you are instructed to use online help. That is absolutely fine for a quick check on something while typing away in a console—provided you are connected to the internet.
PowerShell Studio and PrimalScript have long been able to import PowerShell help files on the fly when needed. The help files were more formatted and included embedded links, enhancing their readability to display alongside the code. As you may imagine, that breaks when you remove the local help files. We considered an easy way out, which would have been to simply retrieve and display the online help information. However, that does not help those working offline (traveling, security reasons) or in a “walled garden” (Proxy servers, firewalls, etc.), as these scenarios provide zero access to help. Next, let’s review how the new PowerShell Help Import features can assist you in these situations.
Importing Online Help
Firstly, we decided to make importing online help for local use easier.
In the PrimalScript Object Browser, you can now right-click on any module and import its online help:
This starts a background process since some of the larger modules—like Microsoft.Graph.Files—are exporting more than 1000 cmdlets, and online help is not a speed demon.
The process collects the online help for each exported command and combines it into local help files, which PrimalScript and PowerShell Studio can use. Local help files are imported right away, taking very little time. If the naming scheme prevents PrimalScript from finding which file to import, a file dialog will appear to let you decide.
Now, this is all well and good for a single module at a time, but given the number of sub-modules in Azure, Graph, or VMWare module collections, this can become an arduous task. So, secondly we endeavored to add a better user interface on top of it.
PowerShell Help Import Tool
The new PowerShell Help Import button on the PrimalScript Help tab launches the new import tool.
Module
The Module column shows you all installed modules (currently only the ones for all users) for the selected PowerShell version.
Available Help
The Available Help column displays whether a specific help file was found or only Online Help is available.
Import Status
The Import Status column indicates if a help file or online help has already been imported for a module. If the status is “Update recommended”, the help file found with the module is newer than the last import.
Importing Help
You can choose individual modules at will, or use the preset buttons, and then add selected others as well. Please note that some online help imports can take up to ten minutes for some of the very large Graph modules, so we suggest doing that when you can let this run for a while.
Offline Environment
How does this help you when you are working in an offline environment? Assuming you have access to a computer connected to the internet, you can import the help for all the modules you require for your work. Then zip all of the files in C:\ProgramData\SAPIEN\Help Data\PowerShell. Move the zipped files to your machine behind a wall and extract them there, replacing all existing files. The goal is to make the folders on both machines identical. Merging is not advisable, as some index files will not reference files that are already there.
This solution is not perfect yet, but it is an essential first step in providing access to help information when you are offline.
Feedback
If you have any questions or suggestions, please feel free to leave a comment below or post in our support forums.