Test-Command checks commands for consistency. Test-Command run a series of static analysis rules on your script, and helps you see if there's anything to improve. It will not run any script, just look at the information about the script, like it's help, command metadata, or the script content itself.
Gets all of the script cop rules, and the relative path to the file defining the rule
Gets the currently defined script cop patrols. A Script Cop patrol groups a number of rules to help easily fix a set of issues.
See the code step by step.