en-US/GoodEnoughRules-help.xml
|
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Measure-BasicWebRequestProperty</command:name> <command:verb>Measure</command:verb> <command:noun>BasicWebRequestProperty</command:noun> <maml:description> <maml:para>Rule to detect if Invoke-WebRequest is used with UseBasicParsing and incompatible properties.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This rule detects if Invoke-WebRequest (or its aliases) is used with the UseBasicParsing parameter and then attempts to access properties that are incompatible with UseBasicParsing. This includes properties like 'Forms', 'ParsedHtml', 'Scripts', and 'AllElements'. This checks for both direct member access after the command as well as variable assignments.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Measure-BasicWebRequestProperty</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>[System.Management.Automation.Language.ScriptBlockAst]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Measure-BasicWebRequestProperty -ScriptBlockAst $ScriptBlockAst</dev:code> <dev:remarks> <maml:para>This will check if the given ScriptBlockAst contains any Invoke-WebRequest commands with UseBasicParsing that access incompatible properties.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Measure-GremlinCharacter</command:name> <command:verb>Measure</command:verb> <command:noun>GremlinCharacter</command:noun> <maml:description> <maml:para>Rule to detect invisible or visually deceptive Unicode characters (gremlins).</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This rule detects Unicode characters that are invisible or visually similar to legitimate characters, such as zero-width spaces, bidirectional overrides, and curly quotes. These characters can introduce subtle bugs or security issues that are nearly impossible to see in an editor.</maml:para> <maml:para>Severity levels reflect how dangerous the character is:</maml:para> <maml:para>- Error - Bidirectional overrides, zero-width spaces, and control characters that can actively obscure code intent or enable Trojan-source attacks. - Warning - Typographic characters (curly quotes, en dash) that are unlikely to be intentional in source code and may cause parse errors. - Information - Characters like non-breaking spaces that are rarely intentional but generally harmless.</maml:para> <maml:para>Inspired by the vscode-gremlins (https://github.com/nhoizey/vscode-gremlins)extension.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Measure-GremlinCharacter</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Token</maml:name> <maml:description> <maml:para>The token to check for gremlin characters.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Token[]</command:parameterValue> <dev:type> <maml:name>Token[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Token</maml:name> <maml:description> <maml:para>The token to check for gremlin characters.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Token[]</command:parameterValue> <dev:type> <maml:name>Token[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>[System.Management.Automation.Language.Token]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Inspired by https://github.com/nhoizey/vscode-gremlins</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Measure-GremlinCharacter -Token $Token</dev:code> <dev:remarks> <maml:para>This will check if the given Token contains any gremlin characters.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Measure-InvokeWebRequestWithoutBasic</command:name> <command:verb>Measure</command:verb> <command:noun>InvokeWebRequestWithoutBasic</command:noun> <maml:description> <maml:para>Rule to detect if Invoke-WebRequest is used without UseBasicParsing.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This rule detects if Invoke-WebRequest (or its aliases) is used without the UseBasicParsing parameter.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Measure-InvokeWebRequestWithoutBasic</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>[System.Management.Automation.Language.ScriptBlockAst]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Measure-InvokeWebRequestWithoutBasic -ScriptBlockAst $ScriptBlockAst</dev:code> <dev:remarks> <maml:para>This will check if the given ScriptBlockAst contains any Invoke-WebRequest commands without the UseBasicParsing parameter.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Measure-SecureStringWithKey</command:name> <command:verb>Measure</command:verb> <command:noun>SecureStringWithKey</command:noun> <maml:description> <maml:para>Rule to detect if ConvertFrom-SecureString is used without a Key.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This rule detects if ConvertFrom-SecureString is used without a Key which means the secret is user and machine bound.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Measure-SecureStringWithKey</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlockAst</maml:name> <maml:description> <maml:para>The scriptblock AST to check.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlockAst</command:parameterValue> <dev:type> <maml:name>ScriptBlockAst</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>[System.Management.Automation.Language.ScriptBlockAst]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>None</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Measure-SecureStringWithKey -ScriptBlockAst $ScriptBlockAst</dev:code> <dev:remarks> <maml:para>This will check if the given ScriptBlockAst contains any ConvertFrom-SecureString commands without a Key parameter.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Measure-TODOComment</command:name> <command:verb>Measure</command:verb> <command:noun>TODOComment</command:noun> <maml:description> <maml:para>Rule to detect if TODO style comments are present.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This rule detects if TODO style comments are present in the given ScriptBlockAst.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Measure-TODOComment</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Token</maml:name> <maml:description> <maml:para>The token to check for TODO comments.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Token[]</command:parameterValue> <dev:type> <maml:name>Token[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Token</maml:name> <maml:description> <maml:para>The token to check for TODO comments.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Token[]</command:parameterValue> <dev:type> <maml:name>Token[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>[System.Management.Automation.Language.ScriptBlockAst]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord[]]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>None</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Measure-TODOComment -ScriptBlockAst $ScriptBlockAst</dev:code> <dev:remarks> <maml:para>This would check if the given ScriptBlockAst contains any TODO comments.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> </helpItems> |