Using Editor from external applications
From PowerGUI Wiki
PowerGUI Detection
Use MsiEnumRelatedProducts, with this lpUpgradeCode: "{FCD94F6A-60AA-4E61-A27B-6344C59938AD}" – to check whether PowerGUI is installed and get the ProductCode (only one version of PowerGUI can be on a given computer).
Using the Product code, you can get various information about the product from MsiGetProductInfo and MsiGetProductInfoEx.
You can get path to the editor by MsiGetComponentPath. For Quest.PowerGUI.ScriptEditor.exe the code is szComponent ="{54FB65AA-70C5-4A08-8796-E85E81846446}", for Quest.PowerGUI.ScriptEditor_x86.exe (32-bit version on 64-bit machines – this is sometimes required when managing PowerShell snapins and COM/other APIs not available in the 64-bit address space) – "{2991EA47-0363-4AB2-A710-162B11D1B0CC}".
Passing Scripts and Getting Them Back
Communications with PowerGUI Script Editor are file-based.
The editor can be launched with the file path as a command-line parameter.
If the editor is already running, the new file will be opened in a new tab.
Similarly you can monitor the file to get the updated version once it is saved from PowerGUI, and PowerGUI editor process to learn when the application exits.
Finding PowerGUI downloads URL and latest version number
If you want to automatically download the latest version of PowerGUI you can find the URL and the version number by checking our online update.xml file.
