{"id":555,"date":"2010-01-14T13:54:00","date_gmt":"2010-01-14T18:54:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=555"},"modified":"2010-01-14T13:55:34","modified_gmt":"2010-01-14T18:55:34","slug":"profiling-a-script","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","title":{"rendered":"Profiling a Script"},"content":{"rendered":"<p>Last summer, Ed Wilson was looking for help with a small part of the book he was finishing up, <a href=\"http:\/\/www.amazon.com\/Windows-PowerShell-Best-Practices-Microsoft\/dp\/0735626464\" target=\"_blank\">Windows PowerShell 2.0 Best Practices<\/a>. The topic he was working on was, \u201cHow do I know this script is safe to run?\u201d Which is a great question and one with greater significance as more administrators come to PowerShell and are tempted to run scripts created elsewhere while not having perhaps all the experience and training to fully appreciate what might happen. I offered some comments on some things I would do. I also decided to write a script (trust me) that an administrator could run that would analyze a PowerShell script and produce a report, or profile, for that script.<\/p>\n<p><!--more--><\/p>\n<p>The version I provided for the book was supposed to be clearly marked as a work in progress.\u00a0 I\u2019ve worked with it on and off since then and it is still a work in progress, but I wanted to offer up the latest version for Ed\u2019s readers and for the PowerShell community.<\/p>\n<div id=\"codeSnippetWrapper\" style=\"border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 10pt; cursor: text;\">\n<div id=\"codeSnippet\" style=\"border-style: none; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><span style=\"color: #008000;\">#REQUIRES -VERSION 2.0<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">&lt;<span style=\"color: #008000;\">#<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Synopsis<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    This <span style=\"color: #0000ff;\">script<\/span> will analyze a PowerShell <span style=\"color: #0000ff;\">script<\/span> and create a <span style=\"color: #0000ff;\">script<\/span> profile.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Description<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    This <span style=\"color: #0000ff;\">script<\/span> analyze a given Powershell <span style=\"color: #0000ff;\">script<\/span> and prepare a <span style=\"color: #0000ff;\">script<\/span> profile.  Within this<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    profile you will see what parameters are called <span style=\"color: #0000ff;\">in<\/span> the analyzed <span style=\"color: #0000ff;\">script<\/span>, where they are called,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    what PowerShell commands are executed, what functions are defined internally  and <span style=\"color: #0000ff;\">if<\/span> the <span style=\"color: #0000ff;\">script<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    is digitally signed.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    The output is written to the pipeline as a document so that you can save it to a file <span style=\"color: #0000ff;\">for<\/span> review.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    If you use the -code parameter, the scripts contents will be included <span style=\"color: #0000ff;\">in<\/span> the <span style=\"color: #0000ff;\">script<\/span> profile.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    If the analyzed <span style=\"color: #0000ff;\">script<\/span> calls another <span style=\"color: #0000ff;\">script<\/span>, references another <span style=\"color: #0000ff;\">script<\/span> via dot sourcing, or loads<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    additional modules and snapins those references will NOT be analyzed, although you should see the<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    lines of code <span style=\"color: #0000ff;\">in<\/span> the <span style=\"color: #0000ff;\">script<\/span> profile so that you can analyze and review further.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Parameter Script<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    The path to the .ps1 <span style=\"color: #0000ff;\">script<\/span> file you want to profile.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Parameter Code<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    If specified, then the <span style=\"color: #0000ff;\">script<\/span><span style=\"color: #006080;\">'s code will be displayed at the end of the profile.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Example<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    PS C:\\&gt; c:\\scripts\\get-scriptprofile foo.ps1 | Out-file FooProfile.txt<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Save the basic script profile to a text file.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Example<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    PS C:\\&gt; c:\\scripts\\get-scriptprofile foo.ps1 -code<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Display the script profile along with the code from foo.ps1<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Example<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    PS C:\\scripts&gt; dir test*.ps1 | .\\get-scriptprofile.ps1<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Build a script profile for every PowerShell script that begins with Test.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Inputs<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Accepts strings as pipelined input<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Outputs<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    [object]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Link<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">   Get-Command<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">   Get-AuthenticodeSignature<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">   About_Functions<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">   About_Parameters<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">   About_Scripts<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">.Notes<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> NAME:      Get-ScriptProfile.ps1<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> VERSION:   1.2<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> AUTHOR:    Jeffery Hicks  http:\/\/jdhitsolutions.com\/blog<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> LASTEDIT:  1\/14\/2010<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> THIS IS A WORK IN PROGRESS...ESPECIALLY WITH POWERSHELL V2.0 SCRIPTS<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> DISCLAIMER AND WARNING:<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    THIS CODE AND INFORMATION ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    IMPLIED WARRANTIES OF MERCHANTABILITY AND\/OR FITNESS FOR A PARTICULAR PURPOSE.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    TEST THOROUGHLY IN A NON-PRODUCTION ENVIRONMENT. IF YOU DON'T KNOW WHAT THIS<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    SCRIPT WILL DO...DO NOT RUN IT!<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"> Microsoft PowerShell Source File -- Created with SAPIEN Technologies PrimalScript 2009<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><span style=\"color: #008000;\">#&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">[CmdletBinding()]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><span style=\"color: #008000;\">#define the parameters<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">Param (<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    [Parameter(<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     ValueFromPipeline=$True,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     Position=0,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     Mandatory=$True,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     HelpMessage=<span style=\"color: #006080;\">\"Enter a the path and name to a PowerShell script\"<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     [String[]]$<span style=\"color: #0000ff;\">script<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    [Parameter(<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     Mandatory=$False,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     HelpMessage=<span style=\"color: #006080;\">\"Specify if you want to see the script's code.\"<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     [<span style=\"color: #0000ff;\">switch<\/span>]$code<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     )<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">Begin {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $ErrorActionPreference=<span style=\"color: #006080;\">\"SilentlyContinue\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    <span style=\"color: #008000;\">#get command information for all current aliaes, functions, filters,cmdlets<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    <span style=\"color: #008000;\">#and external scripts<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $cmdHash=@{}<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Get-Command -CommandType Alias,Function,Filter,ExternalScript,Cmdlet | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      $cmdHash.add($_.name,$_.CommandType)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    <span style=\"color: #008000;\">#define some variables<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $Activity=<span style=\"color: #006080;\">\"Script Profiling\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">} <span style=\"color: #008000;\">#end Begin Scriptblock<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">Process {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    If (-Not (Test-Path $<span style=\"color: #0000ff;\">script<\/span>)) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      Write-Warning <span style=\"color: #006080;\">\"Cannot find $script.\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      <span style=\"color: #0000ff;\">return<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $fullname=(Get-Item $<span style=\"color: #0000ff;\">script<\/span>).Fullname<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Testing Signature\"<\/span> -PercentComplete 10<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write `n<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write $fullname.ToUpper()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write (<span style=\"color: #006080;\">\"Digital Signature: {0}\"<\/span> -f (Get-AuthenticodeSignature $<span style=\"color: #0000ff;\">script<\/span>).status)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Parsing content\"<\/span> -PercentComplete 20<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $data=Get-Command $fullname<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content=($data.scriptContents).Split(<span style=\"color: #006080;\">\"`n\"<\/span>)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    <span style=\"color: #008000;\">#get any requires<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Checking for requirements\"<\/span> -PercentComplete 30<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write `n<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"`nRequires\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"--------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content | where {$_.ToLower() <span style=\"color: #cc6633;\">-match<\/span> <span style=\"color: #006080;\">\"requires -\"<\/span>} | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     <span style=\"color: #008000;\">#parse the requirement and get everything to the left of the first dash<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      $_.Substring($_.IndexOf(<span style=\"color: #006080;\">\"-\"<\/span>)+1).ToLower()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    } |select -unique<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    <span style=\"color: #008000;\">#strip out commented lines<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content=$content | where {$_ <span style=\"color: #cc6633;\">-notmatch<\/span> <span style=\"color: #006080;\">\"^\\s*#\"<\/span>}<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Parsing Parameters\"<\/span> -PercentComplete 45<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"`nParameters\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"----------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $params=@()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $data.parameters.values  | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $params+=$_.name<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $_ | select Name,ParameterType<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"`nParameter usage\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"---------------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $line=$_<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $params | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">if<\/span> ($_ <span style=\"color: #cc6633;\">-eq<\/span> <span style=\"color: #006080;\">\"?\"<\/span>) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          $key=<span style=\"color: #006080;\">\"\\$_\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          [regex]$r=<span style=\"color: #006080;\">\"$key\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">else<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          $key=<span style=\"color: #006080;\">\"$_\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">         [regex]$r=<span style=\"color: #006080;\">\"\\b$key\\b\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">if<\/span> ($line <span style=\"color: #cc6633;\">-match<\/span> $r) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">         write $line.Trim()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       } <span style=\"color: #008000;\">#end if<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     } <span style=\"color: #008000;\">#end foreach param<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     <span style=\"color: #008000;\">#select only unique lines to weed out<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     <span style=\"color: #008000;\">#multiple matches for the same line<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    } | select -Unique <span style=\"color: #008000;\">#end foreach line<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Parsing defined functions\"<\/span> -PercentComplete 60<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"`nInternally Defined Functions\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"----------------------------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">      <span style=\"color: #0000ff;\">if<\/span> ($_ <span style=\"color: #cc6633;\">-match<\/span> <span style=\"color: #006080;\">\"function \\w*.\\w*\"<\/span>) {$matches.values}<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Parsing commands\"<\/span> -PercentComplete 75<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"`nInvoked Commands\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    write <span style=\"color: #006080;\">\"----------------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    $content | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $line=$_<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     $cmdHash.keys | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     <span style=\"color: #008000;\">#escape the ? which is a special regex character<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">if<\/span> ($_ <span style=\"color: #cc6633;\">-eq<\/span> <span style=\"color: #006080;\">\"?\"<\/span>) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          $key=<span style=\"color: #006080;\">\"\\$_\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          [regex]$r=<span style=\"color: #006080;\">\"$key\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">else<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">          $key=<span style=\"color: #006080;\">\"$_\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">         [regex]$r=<span style=\"color: #006080;\">\"\\b$key\\b\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       <span style=\"color: #0000ff;\">if<\/span> ($line <span style=\"color: #cc6633;\">-match<\/span> $r) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">         write $line.Trim()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">       } <span style=\"color: #008000;\">#end if<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">     } <span style=\"color: #008000;\">#end foreach key<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    } | select -unique <span style=\"color: #008000;\">#end foreach content line<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    If ($code) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">        Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Analyzing $script\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Getting script contents\"<\/span> -PercentComplete 90<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">        <span style=\"color: #008000;\">#write script contents if -code was specified<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">        write <span style=\"color: #006080;\">\"`nScript Contents\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">        write <span style=\"color: #006080;\">\"---------------\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">        write $data.scriptcontents<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">} <span style=\"color: #008000;\">#end Process script block<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">End {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">    Write-Progress -Activity $Activity -Status <span style=\"color: #006080;\">\"Done!\"<\/span> -CurrentOperation <span style=\"color: #006080;\">\"Finished\"<\/span> -Completed -PercentComplete 100<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\">} <span style=\"color: #008000;\">#end End script block<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><span style=\"color: #008000;\">#end of script<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 10pt;\"><\/pre>\n<p><!--CRLF--><\/p>\n<\/div>\n<\/div>\n<p>The script, Get-ScriptProfile.ps1 requires PowerShell 2.0 and essentially is a giant string parser. It works pretty well with basic PowerShell 1.0 scripts. The basic syntax is to run the profile script and pass it a PowerShell script as a parameter.<\/p>\n<p>PS C:\\&gt; c:\\scripts\\get-scriptprofile foo.ps1<\/p>\n<p>The profiling script will report:<\/p>\n<ul>\n<li>Whether the script is signed and the state of the signature<\/li>\n<li>If a v2 script, any requirements<\/li>\n<li>What parameters the script takes<\/li>\n<li>The lines of the script where those parameters are used<\/li>\n<li>The names of any internally defined functions<\/li>\n<li>Any invoked PowerShell cmdlet, alias or function<\/li>\n<\/ul>\n<p>All of this information is written to the pipeline more or less as a page but you can pipe the results to <a title=\"Get online help for Out-File\" href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd315303.aspx\" target=\"_blank\">Out-File<\/a> if you wish. Get-ScriptProfile also has a \u2013code parameter which will append the script contents to the output.<\/p>\n<p>The invoked commands section is perhaps the most useful. Within the script I use <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd347726.aspx\" target=\"_blank\">Get-Command<\/a> to get all the currently available commands and then simply look for those commands throughout the script. If I was an admin analyzing a script, I\u2019d be looking out for cmdlets that Stop or Remove.<\/p>\n<p>This is far from a perfect and final tool, and perhaps it can\u2019t be. The download version of the script has a short ToDo list. Many of the items are related to handling PowerShell 2.0 scripts.\u00a0 If you have a suggestion or solution, I hope you\u2019ll let me know.<\/p>\n<div id=\"scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:df1209a2-30bd-4510-90de-761ef0bef1b7\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px; display: inline; float: none; padding: 0px;\">\n<div><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/01\/GetScriptProfile.txt\" target=\"_blank\">Download Get-ScriptProfile.ps1<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Last summer, Ed Wilson was looking for help with a small part of the book he was finishing up, Windows PowerShell 2.0 Best Practices. The topic he was working on was, \u201cHow do I know this script is safe to run?\u201d Which is a great question and one with greater significance as more administrators come&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,75,8],"tags":[552,152,120,540],"class_list":["post-555","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-v2-0","category-scripting","tag-best-practices","tag-ed-wilson","tag-powergui","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Profiling a Script &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Profiling a Script &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Last summer, Ed Wilson was looking for help with a small part of the book he was finishing up, Windows PowerShell 2.0 Best Practices. The topic he was working on was, \u201cHow do I know this script is safe to run?\u201d Which is a great question and one with greater significance as more administrators come...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-01-14T18:54:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2010-01-14T18:55:34+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Profiling a Script\",\"datePublished\":\"2010-01-14T18:54:00+00:00\",\"dateModified\":\"2010-01-14T18:55:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/\"},\"wordCount\":418,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Best Practices\",\"Ed Wilson\",\"PowerGUI\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/\",\"name\":\"Profiling a Script &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2010-01-14T18:54:00+00:00\",\"dateModified\":\"2010-01-14T18:55:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/555\\\/profiling-a-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Profiling a Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Profiling a Script &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","og_locale":"en_US","og_type":"article","og_title":"Profiling a Script &#8226; The Lonely Administrator","og_description":"Last summer, Ed Wilson was looking for help with a small part of the book he was finishing up, Windows PowerShell 2.0 Best Practices. The topic he was working on was, \u201cHow do I know this script is safe to run?\u201d Which is a great question and one with greater significance as more administrators come...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-01-14T18:54:00+00:00","article_modified_time":"2010-01-14T18:55:34+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Profiling a Script","datePublished":"2010-01-14T18:54:00+00:00","dateModified":"2010-01-14T18:55:34+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/"},"wordCount":418,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Best Practices","Ed Wilson","PowerGUI","Scripting"],"articleSection":["PowerShell","PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/","name":"Profiling a Script &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2010-01-14T18:54:00+00:00","dateModified":"2010-01-14T18:55:34+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/555\/profiling-a-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Profiling a Script"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":7468,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7468\/powershell-7-scripting-with-the-powershell-ise\/","url_meta":{"origin":555,"position":0},"title":"PowerShell 7 Scripting with the PowerShell ISE","author":"Jeffery Hicks","date":"May 11, 2020","format":false,"excerpt":"By now, everyone should have gotten the memo that with the move to PowerShell 7, the PowerShell ISE should be considered deprecated. When it comes to PowerShell script and module development for PowerShell 7, the recommended tool is Visual Studio Code. It is free and offers so much more than\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1036,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1036\/join-me-in-orlando\/","url_meta":{"origin":555,"position":1},"title":"Join Me in Orlando","author":"Jeffery Hicks","date":"December 30, 2010","format":false,"excerpt":"I will be presenting 3 sessions at Techmentor Orlando 2011. The conference runs March 14-18, 2011 at the Disney Yacht Club. My sessions are all on Wednesday March 16. In addition to all the other fabulous material at the conference I will be presenting the following: PowerShell Scripting Best Practices\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"Disney Yacht Club","src":"https:\/\/i0.wp.com\/techmentorevents.com\/design\/ecg\/techmentorevents\/home\/img\/portal_2011spring.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3722,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3722\/reflections-on-the-powershell-scripting-games\/","url_meta":{"origin":555,"position":2},"title":"Reflections on the PowerShell Scripting Games","author":"Jeffery Hicks","date":"February 26, 2014","format":false,"excerpt":"During the most recent PowerShell Scripting Games, I was fortunate enough to be one of the judges. Now that the games have concluded I thought I'd share my reflections on the entries. Naturally these are merely my opinions but they are drawn from years of experience with PowerShell and almost\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"talkbubble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4713,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4713\/a-festive-christmas-message\/","url_meta":{"origin":555,"position":3},"title":"A Festive Christmas Message","author":"Jeffery Hicks","date":"December 24, 2015","format":false,"excerpt":"The year is winding down and it is getting harder and harder to remain productive.\u00a0 So I'm trying to combine having some fun while still trying to help you learn PowerShell. I wrote a simple PowerShell script that randomly selects a Christmas themed quote and displays in a colorful fashion.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"A Christmas Message","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3909,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3909\/so-you-need-to-write-a-powershell-script\/","url_meta":{"origin":555,"position":4},"title":"So you need to write a PowerShell script","author":"Jeffery Hicks","date":"July 7, 2014","format":false,"excerpt":"So...you have decided to write a PowerShell script or have at least identified a need. What do you do first? If you say \"Google or Bing\", I'd say you are wrong. In my opinion, when you are developing a PowerShell script, searching for an existing script is not the first\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"lightbulb-idea","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1247,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1247\/techmentor-orlando-2011-decks-and-demos\/","url_meta":{"origin":555,"position":5},"title":"Techmentor Orlando 2011 Decks and Demos","author":"Jeffery Hicks","date":"March 21, 2011","format":false,"excerpt":"As promised, I have put together the most current versions of my slide decks and demos. A word of caution on the demos: many of them were designed to be used with my Start-Demo function, which essentially steps through the demo file one line at a time. The AD demos\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/TM_2011spring.gif?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=555"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/555\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}