PSScriptAnalyzer

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
DAMACSB
Posts: 17
Joined: Thu Apr 07, 2016 10:21 am

PSScriptAnalyzer

Post by DAMACSB »

Product, version and build: Sapien Suite 2016, Primal Script - version: 7.6.84
32 or 64 bit version of product: 32bit
Operating system: Windows 7 Pro
32 or 64 bit OS: 32 bit, virtualized on Oracle's VirtualBox

Error: PSScriptAnalyzer is not installed in its default location0 error(s), 0 warning(s)
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

User avatar
Alexander Riedel
Posts: 7404
Joined: Tue May 29, 2007 4:43 pm

Re: PSScriptAnalyzer

Post by Alexander Riedel »

Install the PSScriptAnalyzer module in one of the two default locations:
Under "Program Files" or under "My Documents\Windows PowerShell"
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
DAMACSB
Posts: 17
Joined: Thu Apr 07, 2016 10:21 am

Re: PSScriptAnalyzer

Post by DAMACSB »

Ok. I'm in left field here. Where do I get the module?

User avatar
juneblender
Posts: 93
Joined: Thu Jul 24, 2014 3:26 pm

Re: PSScriptAnalyzer

Post by juneblender »

The PSScriptAnalyzer module is available on the PowerShell Gallery. You can get it on GitHub, too (https://github.com/PowerShell/PSScriptAnalyzer), but I would stick with the released version. To get modules from the PowerShell Gallery, you need the PowerShellGet module.

Here's the installation sequence:

1. Install the PackageManagement and PowerShellGet modules from the Microsoft Download Center: https://www.microsoft.com/en-us/downloa ... x?id=49186

2. Use the Install-Module cmdlet to install the PSScriptAnalyzer module. I prefer to install the modules in $home\Documents\WindowsPowerShell\Modules, because you can install/uninstall without admin privileges, but your environment might dictate that choice.

Install-Module PSScriptAnalyzer -Scope CurrentUser

If you prefer to examine the module before installing it, you can use the Save-Module cmdlet to save it to a location that is not in the $env:PSModulePath list.

Let us know if you need any other help.

User avatar
DAMACSB
Posts: 17
Joined: Thu Apr 07, 2016 10:21 am

Re: PSScriptAnalyzer

Post by DAMACSB »

Thanks. Got it.

Locked