none
PowerShell ISE -- Script Analyzer RRS feed

Answers

  • Place this in your ISE profile:

    import-module ISEScriptAnalyzerAddOn


    \_(ツ)_/

    • Marked as answer by dreivilo47 Tuesday, February 19, 2019 5:34 PM
    Friday, February 15, 2019 12:39 PM
  • Install-module psscriptanalyzer

    Install-Module ISEScriptAnalyzerAddOn


    \_(ツ)_/

    • Marked as answer by dreivilo47 Tuesday, February 19, 2019 5:34 PM
    Thursday, February 14, 2019 7:30 PM

All replies

  • Install-module psscriptanalyzer

    Install-Module ISEScriptAnalyzerAddOn


    \_(ツ)_/

    • Marked as answer by dreivilo47 Tuesday, February 19, 2019 5:34 PM
    Thursday, February 14, 2019 7:30 PM
  • jrv, thank you for your reply.

    I have done the following things:
    01) Opened PowerShell ISE (as admin)
    02) In the console of the PowerShell ISE:
          1) Install-module psscriptanalyzer
          2) Install-Module ISEScriptAnalyzerAddOn
    03) Closed PowerShell ISE and opened it again (as admin)

    How to use the ISE Script Analyzer?  I don't see anything to use it.

    In the folder "C:\Program Files (x86)\WindowsPowerShell\Modules" aren't traces of both installations.  Is this normal?

    Friday, February 15, 2019 12:30 PM
  • It is located here:

     C:\Users\j<userid>\OneDrive\Documents\WindowsPowerShell\Modules


    \_(ツ)_/

    Friday, February 15, 2019 12:35 PM
  • Place this in your ISE profile:

    import-module ISEScriptAnalyzerAddOn


    \_(ツ)_/

    • Marked as answer by dreivilo47 Tuesday, February 19, 2019 5:34 PM
    Friday, February 15, 2019 12:39 PM
  • It is located here:

     C:\Users\j<userid>\OneDrive\Documents\WindowsPowerShell\Modules


    \_(ツ)_/

    At my side, it is located here: C:\Program Files\WindowsPowerShell\Modules
    Monday, February 18, 2019 1:13 PM
  • That is not the default location.  If you open ISE and run the two installs they will be in "MyDocuments\WindowsPowerShell\Modules" .  My documents are relocated to OneDrive so that is in my path.

    If you install as an elevated admin then they will be in your location.

    You will still have to impart the ScriptAnalyzer when you want to use it or place it in your $profile.


    \_(ツ)_/

    Monday, February 18, 2019 1:17 PM
  • Place this in your ISE profile:

    import-module ISEScriptAnalyzerAddOn


    \_(ツ)_/


    I have placed this in my ISE profile: import-module ISEScriptAnalyzerAddOn
    Then I have closed PowerShell ISE and opened it again (as admin).
    Now, I have on the right side a tab named "Script Analyzer".
    Monday, February 18, 2019 1:17 PM
  • Do you have a short example (1 line) of bad code, so I can test the Script Analyzer?
    Monday, February 18, 2019 1:20 PM
  • Just open any one of your scripts and run it.

    Search for blogs that discuss using code analyzers and what they do.  It will not debug your code.  It does not test logic.  It only applies rules to the code.  The default rules are trivial.  TO get what you want you will likely need to define your own rules or get custom rules from one of the people who have created custom rule sets.


    \_(ツ)_/

    • Marked as answer by dreivilo47 Tuesday, February 19, 2019 5:34 PM
    • Unmarked as answer by dreivilo47 Tuesday, February 19, 2019 5:35 PM
    Monday, February 18, 2019 1:27 PM
  • Ok, thanks for the information.
    My problem is solved.
    Thank you very much for the support jrv!
    Tuesday, February 19, 2019 5:33 PM
  • Glad you are set.  Good luck.


    \_(ツ)_/

    Tuesday, February 19, 2019 6:15 PM