en-AU/PSRule-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>Get-PSRule</command:name> <command:verb>Get</command:verb> <command:noun>PSRule</command:noun> <maml:description> <maml:para>Get a list of rule definitions.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Get a list of matching rule definitions within the search path.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSRule</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to list. If this parameter is not specified all rules in search paths will be listed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only get rules with the specified tags set. If this parameter is not specified all rules in search paths will be returned.</maml:para> <maml:para>When more then one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Look for modules containing rule definitions including modules that are currently not imported.</maml:para> <maml:para>This switch is used with the `-Module` parameter.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to list. If this parameter is not specified all rules in search paths will be listed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only get rules with the specified tags set. If this parameter is not specified all rules in search paths will be returned.</maml:para> <maml:para>When more then one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Look for modules containing rule definitions including modules that are currently not imported.</maml:para> <maml:para>This switch is used with the `-Module` parameter.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Rules.Rule</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>Get-PSRule; RuleName Description -------- ----------- isFruit An example rule</dev:code> <dev:remarks> <maml:para>Get a list of rule definitions from the current working path.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/Get-PSRule.html</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-PSRule</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </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>Get-PSRuleHelp</command:name> <command:verb>Get</command:verb> <command:noun>PSRuleHelp</command:noun> <maml:description> <maml:para>Get documentation for a rule.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Get documentation for a rule.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSRuleHelp</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of the rule to get documentation for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>A path to check documentation for. If this is not specified, documentation is sourced for imported modules.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Limit returned information to rules in the specified module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Online</maml:name> <maml:Description> <maml:para>Instead of displaying documentation within PowerShell, browse to the online version using the default web browser.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of the rule to get documentation for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>A path to check documentation for. If this is not specified, documentation is sourced for imported modules.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Limit returned information to rules in the specified module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Online</maml:name> <maml:Description> <maml:para>Instead of displaying documentation within PowerShell, browse to the online version using the default web browser.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Rules.RuleHelpInfo</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>Get-PSRuleHelp Azure.ACR.AdminUser;</dev:code> <dev:remarks> <maml:para>Get rule documentation for the rule `Azure.ACR.AdminUser`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>Get-PSRuleHelp Azure.ACR.AdminUser -Online;</dev:code> <dev:remarks> <maml:para>Browse to the online version of documentation for `Azure.ACR.AdminUser` using the default web browser.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/Get-PSRuleHelp.html</maml:uri> </maml:navigationLink> </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>Invoke-PSRule</command:name> <command:verb>Invoke</command:verb> <command:noun>PSRule</command:noun> <maml:description> <maml:para>Evaluate objects against matching rules.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Evaluate objects against matching rules.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Invoke-PSRule</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Outcome</maml:name> <maml:Description> <maml:para>Filter output to only show rules with a specific outcome.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Pass</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Fail</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Error</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">RuleOutcome</command:parameterValue> <dev:type> <maml:name>RuleOutcome</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Pass, Fail, Error</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="TargetObject"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>The pipeline object to process rules for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>As</maml:name> <maml:Description> <maml:para>The type of results to produce. Detailed results are generated by default.</maml:para> <maml:para>The following result formats are available:</maml:para> <maml:para>- `Detail` - Returns pass/ fail results for each individual object</maml:para> <maml:para>- `Summary` - Returns summarized results for the rule and the worst outcome</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Detail</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Summary</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detail</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Detect</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Configures the format that output is presented in.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NUnit3</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-PSRule</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Outcome</maml:name> <maml:Description> <maml:para>Filter output to only show rules with a specific outcome.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Pass</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Fail</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Error</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">RuleOutcome</command:parameterValue> <dev:type> <maml:name>RuleOutcome</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Pass, Fail, Error</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>As</maml:name> <maml:Description> <maml:para>The type of results to produce. Detailed results are generated by default.</maml:para> <maml:para>The following result formats are available:</maml:para> <maml:para>- `Detail` - Returns pass/ fail results for each individual object</maml:para> <maml:para>- `Summary` - Returns summarized results for the rule and the worst outcome</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Detail</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Summary</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detail</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Detect</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InputPath</maml:name> <maml:Description> <maml:para>Instead of processing objects from the pipeline, import objects file the specified file paths.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Configures the format that output is presented in.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NUnit3</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Outcome</maml:name> <maml:Description> <maml:para>Filter output to only show rules with a specific outcome.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">RuleOutcome</command:parameterValue> <dev:type> <maml:name>RuleOutcome</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Pass, Fail, Error</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="TargetObject"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>The pipeline object to process rules for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>As</maml:name> <maml:Description> <maml:para>The type of results to produce. Detailed results are generated by default.</maml:para> <maml:para>The following result formats are available:</maml:para> <maml:para>- `Detail` - Returns pass/ fail results for each individual object</maml:para> <maml:para>- `Summary` - Returns summarized results for the rule and the worst outcome</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detail</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InputPath</maml:name> <maml:Description> <maml:para>Instead of processing objects from the pipeline, import objects file the specified file paths.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Configures the format that output is presented in.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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.PSObject</maml:name> </dev:type> <maml:description> <maml:para>You can pipe any object to Invoke-PSRule .</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Rules.RuleRecord</maml:name> </dev:type> <maml:description> <maml:para>This is the default.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>PSRule.Rules.RuleSummaryRecord</maml:name> </dev:type> <maml:description> <maml:para>When you use the `-As Summary`. Otherwise, it returns a `RuleRecord` object.</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>@{ Name = 'Item 1' } | Invoke-PSRule;</dev:code> <dev:remarks> <maml:para>Evaluate a simple hashtable on the pipeline against rules loaded from the current working path.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code># Define objects to validate $items = @(); $items += [PSCustomObject]@{ Name = 'Fridge' }; $items += [PSCustomObject]@{ Name = 'Apple' }; # Validate each item using rules saved in current working path $items | Invoke-PSRule; TargetName: Fridge RuleName Outcome Message -------- ------- ------- isFruit Fail Fruit is only Apple, Orange and Pear TargetName: Apple RuleName Outcome Message -------- ------- ------- isFruit Pass Fruit is only Apple, Orange and Pear</dev:code> <dev:remarks> <maml:para>Evaluate an array of objects on the pipeline against rules loaded from the current working path.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code># Define objects to validate $items = @(); $items += [PSCustomObject]@{ Name = 'Fridge' }; $items += [PSCustomObject]@{ Name = 'Apple' }; # Validate each item and only return failing results $items | Invoke-PSRule -Outcome Fail; TargetName: Fridge RuleName Outcome Message -------- ------- ------- isFruit Fail Fruit is only Apple, Orange and Pear</dev:code> <dev:remarks> <maml:para>Evaluate an array of objects, only failing object results are returned.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 4 --------------------------</maml:title> <dev:code># Define objects to validate $items = @(); $items += [PSCustomObject]@{ Name = 'Fridge' }; $items += [PSCustomObject]@{ Name = 'Apple' }; # Validate each item and show rule summary $items | Invoke-PSRule -As Summary; RuleName Pass Fail Outcome -------- ---- ---- ------- isFruit 1 1 Fail</dev:code> <dev:remarks> <maml:para>Evaluate an array of objects. The results for each rule is returned as a summary. Outcome is represented as the worst outcome.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/Invoke-PSRule.html</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSRule</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSRuleTarget</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </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>New-PSRuleOption</command:name> <command:verb>New</command:verb> <command:noun>PSRuleOption</command:noun> <maml:description> <maml:para>Create options to configure PSRule execution.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The New-PSRuleOption cmdlet creates an options object that can be passed to PSRule cmdlets to configure execution.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSRuleOption</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. Option also accepts a hashtable to configure options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>The path to a YAML file containing options. By default the current working path (`$PWD`) is used.</maml:para> <maml:para>Either a directory or file path can be specified. When a directory is used, `ps-rule.yaml` will be used as the file name.</maml:para> <maml:para>If the `-Path` parameter is specified and the file does not exist, an exception will be generated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SuppressTargetName</maml:name> <maml:Description> <maml:para>Configures suppression for a list of objects by TargetName. SuppressTargetName also accepts a hashtable to configure rule suppression.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">SuppressionOption</command:parameterValue> <dev:type> <maml:name>SuppressionOption</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="none"> <maml:name>BindTargetName</maml:name> <maml:Description> <maml:para>Configures a custom function to use to bind TargetName of an object.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BindTargetName[]</command:parameterValue> <dev:type> <maml:name>BindTargetName[]</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="none"> <maml:name>BaselineConfiguration</maml:name> <maml:Description> <maml:para>Configures a set of baseline configuration values that can be used in rule definitions instead of using hard coded values. BaselineConfiguration also accepts a hashtable of configuration values as key/ value pairs.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BaselineConfiguration</command:parameterValue> <dev:type> <maml:name>BaselineConfiguration</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="none"> <maml:name>BindTargetType</maml:name> <maml:Description> <maml:para>Configures a custom function to use to bind TargetType of an object.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BindTargetName[]</command:parameterValue> <dev:type> <maml:name>BindTargetName[]</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="none"> <maml:name>BindingIgnoreCase</maml:name> <maml:Description> <maml:para>Sets the option `Binding.IgnoreCase`. The option `Binding.IgnoreCase` determines if binding operations are case-sensitive or not. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="BindingTargetName"> <maml:name>TargetName</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetName`. This option specifies one or more properties of TargetObject to use to bind TargetName to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="BindingTargetType"> <maml:name>TargetType</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetType`. This option specifies one or more properties of TargetObject to use to bind TargetType to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="ExecutionInconclusiveWarning"> <maml:name>InconclusiveWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.InconclusiveWarning`. The `Execution.InconclusiveWarning` option determines if a warning is generated when the outcome of a rule is inconclusive. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="ExecutionNotProcessedWarning"> <maml:name>NotProcessedWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.NotProcessedWarning`. The `Execution.NotProcessedWarning` option determines if a warning is generated when an object is not processed by any rule. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="InputFormat"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Sets the `Input.Format` option to configure the input format for when a string is passed in as a target object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</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="InputObjectPath"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>Sets the `Input.ObjectPath` option to use an object path to use instead of the pipeline object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>LoggingRuleFail</maml:name> <maml:Description> <maml:para>Sets the `Logging.RuleFail` option to generate an informational message for each rule fail.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>LoggingRulePass</maml:name> <maml:Description> <maml:para>Sets the `Logging.RulePass` option to generate an informational message for each rule pass.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>OutputAs</maml:name> <maml:Description> <maml:para>Sets the option `Output.As`. The `Output.As` option configures the type of results to produce, either detail or summary.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</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="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Sets the option `Output.Format`. The `Output.Format` option configures the format that results will be presented in.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. Option also accepts a hashtable to configure options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>The path to a YAML file containing options. By default the current working path (`$PWD`) is used.</maml:para> <maml:para>Either a directory or file path can be specified. When a directory is used, `ps-rule.yaml` will be used as the file name.</maml:para> <maml:para>If the `-Path` parameter is specified and the file does not exist, an exception will be generated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SuppressTargetName</maml:name> <maml:Description> <maml:para>Configures suppression for a list of objects by TargetName. SuppressTargetName also accepts a hashtable to configure rule suppression.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">SuppressionOption</command:parameterValue> <dev:type> <maml:name>SuppressionOption</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="none"> <maml:name>BindTargetName</maml:name> <maml:Description> <maml:para>Configures a custom function to use to bind TargetName of an object.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BindTargetName[]</command:parameterValue> <dev:type> <maml:name>BindTargetName[]</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="none"> <maml:name>BaselineConfiguration</maml:name> <maml:Description> <maml:para>Configures a set of baseline configuration values that can be used in rule definitions instead of using hard coded values. BaselineConfiguration also accepts a hashtable of configuration values as key/ value pairs.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BaselineConfiguration</command:parameterValue> <dev:type> <maml:name>BaselineConfiguration</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="none"> <maml:name>BindTargetType</maml:name> <maml:Description> <maml:para>Configures a custom function to use to bind TargetType of an object.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">BindTargetName[]</command:parameterValue> <dev:type> <maml:name>BindTargetName[]</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="none"> <maml:name>BindingIgnoreCase</maml:name> <maml:Description> <maml:para>Sets the option `Binding.IgnoreCase`. The option `Binding.IgnoreCase` determines if binding operations are case-sensitive or not. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="BindingTargetName"> <maml:name>TargetName</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetName`. This option specifies one or more properties of TargetObject to use to bind TargetName to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="BindingTargetType"> <maml:name>TargetType</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetType`. This option specifies one or more properties of TargetObject to use to bind TargetType to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="ExecutionInconclusiveWarning"> <maml:name>InconclusiveWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.InconclusiveWarning`. The `Execution.InconclusiveWarning` option determines if a warning is generated when the outcome of a rule is inconclusive. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="ExecutionNotProcessedWarning"> <maml:name>NotProcessedWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.NotProcessedWarning`. The `Execution.NotProcessedWarning` option determines if a warning is generated when an object is not processed by any rule. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</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="InputFormat"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Sets the `Input.Format` option to configure the input format for when a string is passed in as a target object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</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="InputObjectPath"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>Sets the `Input.ObjectPath` option to use an object path to use instead of the pipeline object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>LoggingRuleFail</maml:name> <maml:Description> <maml:para>Sets the `Logging.RuleFail` option to generate an informational message for each rule fail.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>LoggingRulePass</maml:name> <maml:Description> <maml:para>Sets the `Logging.RulePass` option to generate an informational message for each rule pass.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>OutputAs</maml:name> <maml:Description> <maml:para>Sets the option `Output.As`. The `Output.As` option configures the type of results to produce, either detail or summary.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</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="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Sets the option `Output.Format`. The `Output.Format` option configures the format that results will be presented in.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Configuration.PSRuleOption</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>$option = New-PSRuleOption -Option @{ 'execution.mode' = 'ConstrainedLanguage' } @{ Name = 'Item 1' } | Invoke-PSRule -Option $option</dev:code> <dev:remarks> <maml:para>Create an options object and run rules in constrained mode.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>$option = New-PSRuleOption -SuppressTargetName @{ 'storageAccounts.UseHttps' = 'TestObject1', 'TestObject3' };</dev:code> <dev:remarks> <maml:para>Create an options object that suppresses `TestObject1` and `TestObject3` for a rule named `storageAccounts.UseHttps`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code># Create a custom function that returns a TargetName string $bindFn = { param ($TargetObject) $otherName = $TargetObject.PSObject.Properties['OtherName']; if ($otherName -eq $Null) { return $Null } return $otherName.Value; } # Specify the binding function script block code to execute $option = New-PSRuleOption -BindTargetName $bindFn;</dev:code> <dev:remarks> <maml:para>Creates an options object that uses a custom function to bind the TargetName of an object.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 4 --------------------------</maml:title> <dev:code>$option = New-PSRuleOption -BaselineConfiguration @{ 'appServiceMinInstanceCount' = 2 };</dev:code> <dev:remarks> <maml:para>Create an options object that sets the `appServiceMinInstanceCount` baseline configuration option to `2`.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/New-PSRuleOption.html</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-PSRule</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSRuleOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </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>Set-PSRuleOption</command:name> <command:verb>Set</command:verb> <command:noun>PSRuleOption</command:noun> <maml:description> <maml:para>Sets options that configure PSRule execution.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Sets options that configure PSRule execution.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Set-PSRuleOption</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>The path to a YAML file where options will be set. By default the current working path (`$PWD`) is used.</maml:para> <maml:para>Either a directory or file path can be specified. When a directory is used, `ps-rule.yaml` will be used as the file name.</maml:para> <maml:para>The file will be created if it does not exist. If the file already exists it will be merged with the existing options and overwritten .</maml:para> <maml:para>If the directory does not exist an error will be generated. To force the creation of the directory path use the `-Force` switch.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>An options object to use.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Use this option to return the options object to the pipeline instead of saving to disk.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Force creation of directory path for Path parameter, when the directory does not already exist.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowClobber</maml:name> <maml:Description> <maml:para>Overwrite YAML files that contain comments.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>BindingIgnoreCase</maml:name> <maml:Description> <maml:para>Sets the option `Binding.IgnoreCase`. The option `Binding.IgnoreCase` determines if binding operations are case-sensitive or not. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="BindingTargetName"> <maml:name>TargetName</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetName`. This option specifies one or more properties of TargetObject to use to bind TargetName to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="BindingTargetType"> <maml:name>TargetType</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetType`. This option specifies one or more properties of TargetObject to use to bind TargetType to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="ExecutionInconclusiveWarning"> <maml:name>InconclusiveWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.InconclusiveWarning`. The `Execution.InconclusiveWarning` option determines if a warning is generated when the outcome of a rule is inconclusive. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>True</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ExecutionNotProcessedWarning"> <maml:name>NotProcessedWarning</maml:name> <maml:Description> <maml:para>Sets the `Execution.NotProcessedWarning` option. The `Execution.NotProcessedWarning` option determines if a warning is generated when an object is not processed by any rule. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>True</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="InputFormat"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Sets the `Input.Format` option to configure the input format for when a string is passed in as a target object.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Detect</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="InputObjectPath"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>Sets the `Input.ObjectPath` option to use an object path to use instead of the pipeline object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>LoggingRuleFail</maml:name> <maml:Description> <maml:para>Sets the `Logging.RuleFail` option to generate an informational message for each rule fail.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Error</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Warning</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Information</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>LoggingRulePass</maml:name> <maml:Description> <maml:para>Sets the `Logging.RulePass` option to generate an informational message for each rule pass.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Error</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Warning</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Information</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>OutputAs</maml:name> <maml:Description> <maml:para>Sets the option `Output.As`. The `Output.As` option configures the type of results to produce, either detail or summary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Detail</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Summary</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detail</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Sets the option `Output.Format`. The `Output.Format` option configures the format that results will be presented in.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NUnit3</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</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="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>The path to a YAML file where options will be set. By default the current working path (`$PWD`) is used.</maml:para> <maml:para>Either a directory or file path can be specified. When a directory is used, `ps-rule.yaml` will be used as the file name.</maml:para> <maml:para>The file will be created if it does not exist. If the file already exists it will be merged with the existing options and overwritten .</maml:para> <maml:para>If the directory does not exist an error will be generated. To force the creation of the directory path use the `-Force` switch.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>An options object to use.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Use this option to return the options object to the pipeline instead of saving to disk.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Force creation of directory path for Path parameter, when the directory does not already exist.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowClobber</maml:name> <maml:Description> <maml:para>Overwrite YAML files that contain comments.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>BindingIgnoreCase</maml:name> <maml:Description> <maml:para>Sets the option `Binding.IgnoreCase`. The option `Binding.IgnoreCase` determines if binding operations are case-sensitive or not. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="BindingTargetName"> <maml:name>TargetName</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetName`. This option specifies one or more properties of TargetObject to use to bind TargetName to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="BindingTargetType"> <maml:name>TargetType</maml:name> <maml:Description> <maml:para>Sets the option `Binding.TargetType`. This option specifies one or more properties of TargetObject to use to bind TargetType to. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="ExecutionInconclusiveWarning"> <maml:name>InconclusiveWarning</maml:name> <maml:Description> <maml:para>Sets the option `Execution.InconclusiveWarning`. The `Execution.InconclusiveWarning` option determines if a warning is generated when the outcome of a rule is inconclusive. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>True</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ExecutionNotProcessedWarning"> <maml:name>NotProcessedWarning</maml:name> <maml:Description> <maml:para>Sets the `Execution.NotProcessedWarning` option. The `Execution.NotProcessedWarning` option determines if a warning is generated when an object is not processed by any rule. See about_PSRule_Options for more information.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Boolean</command:parameterValue> <dev:type> <maml:name>Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>True</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="InputFormat"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Sets the `Input.Format` option to configure the input format for when a string is passed in as a target object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="InputObjectPath"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>Sets the `Input.ObjectPath` option to use an object path to use instead of the pipeline object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>LoggingRuleFail</maml:name> <maml:Description> <maml:para>Sets the `Logging.RuleFail` option to generate an informational message for each rule fail.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>LoggingRulePass</maml:name> <maml:Description> <maml:para>Sets the `Logging.RulePass` option to generate an informational message for each rule pass.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutcomeLogStream</command:parameterValue> <dev:type> <maml:name>OutcomeLogStream</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="none"> <maml:name>OutputAs</maml:name> <maml:Description> <maml:para>Sets the option `Output.As`. The `Output.As` option configures the type of results to produce, either detail or summary.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ResultFormat</command:parameterValue> <dev:type> <maml:name>ResultFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detail</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputFormat</maml:name> <maml:Description> <maml:para>Sets the option `Output.Format`. The `Output.Format` option configures the format that results will be presented in.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">OutputFormat</command:parameterValue> <dev:type> <maml:name>OutputFormat</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="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Configuration.PSRuleOption</maml:name> </dev:type> <maml:description> <maml:para>When you use the `-PassThru` switch, an options object is returned to the pipeline.</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>PS C:\> Set-PSRuleOption -OutputFormat Yaml;</dev:code> <dev:remarks> <maml:para>Sets the `Output.Format` to `Yaml` for `ps-rule.yaml` in the current working path. If the `ps-rule.yaml` file exists, it is merged with the existing file and overwritten. If the file does not exist, a new file is created.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Set-PSRuleOption -OutputFormat Yaml -Path .\project-options.yaml;</dev:code> <dev:remarks> <maml:para>Sets the `Output.Format` to `Yaml` for `project-options.yaml` in the current working path. If the `project-options.yaml` file exists, it is merged with the existing file and overwritten. If the file does not exist, a new file is created.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/Set-PSRuleOption.html</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSRuleOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </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>Test-PSRuleTarget</command:name> <command:verb>Test</command:verb> <command:noun>PSRuleTarget</command:noun> <maml:description> <maml:para>Pass or fail objects against matching rules.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Evaluate objects against matching rules and return an overall pass or fail for the object as `$True` (pass) or `$False` (fail).</maml:para> <maml:para>PSRule uses the following logic to determine overall pass or fail for an object:</maml:para> <maml:para>- The object fails if: - Any rules fail or error. - Any rules are inconclusive. - The object passes if: - No rules were found that match preconditions, name and tag filters. - All rules pass.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-PSRuleTarget</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="TargetObject"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>The pipeline object to process rules for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Detect</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Test-PSRuleTarget</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Yaml</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Json</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Detect</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InputPath</maml:name> <maml:Description> <maml:para>Instead of processing objects from the pipeline, import objects file the specified file paths.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Path</maml:name> <maml:Description> <maml:para>One or more paths to search for rule definitions within.</maml:para> <maml:para>If this parameter is not specified the current working path will be used, unless the `-Module` parameter is used.</maml:para> <maml:para>If the `-Module` parameter is used, rule definitions from the currently working path will not be included by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="n"> <maml:name>Name</maml:name> <maml:Description> <maml:para>The name of a specific rule to evaluate. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Tag</maml:name> <maml:Description> <maml:para>Only evaluate rules with the specified tags set. If this parameter is not specified all rules in search paths will be evaluated.</maml:para> <maml:para>When more than one tag is used, all tags must match. Tag names are not case sensitive, tag values are case sensitive. A tag value of `*` may be used to filter rules to any rule with the tag set, regardless of tag value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="TargetObject"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>The pipeline object to process rules for.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</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="none"> <maml:name>Option</maml:name> <maml:Description> <maml:para>Additional options that configure execution. A `PSRuleOption` can be created by using the `New-PSRuleOption` cmdlet. Alternatively, a hashtable or path to YAML file can be specified with options.</maml:para> <maml:para>For more information on PSRule options see about_PSRule_Options.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSRuleOption</command:parameterValue> <dev:type> <maml:name>PSRuleOption</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="none"> <maml:name>Format</maml:name> <maml:Description> <maml:para>Configures the input format for when a string is passed in as a target object.</maml:para> <maml:para>- When the `-InputObject` parameter or pipeline input is used, strings are treated as plain text by default. When this option is used and set to either `Yaml` or `Json`, strings are read as YAML or JSON and are converted to an object.</maml:para> <maml:para>- When the `-InputPath` parameter is used with a file path or URL, by default the file extension (either `.yaml`, `.yml` or `.json`) will be used to automatically detect the format as YAML or JSON.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">InputFormat</command:parameterValue> <dev:type> <maml:name>InputFormat</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Detect</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ObjectPath</maml:name> <maml:Description> <maml:para>The name of a property to use instead of the pipeline object. If the property specified by `ObjectPath` is a collection or an array, then each item in evaluated separately.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</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="none"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Search for rule definitions within a module. When specified without the `-Path` parameter, only rule definitions in the module will be discovered.</maml:para> <maml:para>When both `-Path` and `-Module` are specified, rule definitions from both are discovered.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InputPath</maml:name> <maml:Description> <maml:para>Instead of processing objects from the pipeline, import objects file the specified file paths.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</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="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for rule documentation and messages. By default, the culture of PowerShell is used.</maml:para> <maml:para>This option does not affect the culture used for the PSRule engine, which always uses the culture of PowerShell.</maml:para> <maml:para>The PowerShell cmdlet `Get-Culture` shows the current culture of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Boolean</maml:name> </dev:type> <maml:description> <maml:para>Returns `$True` when the object passes and `$False` when the object fails.</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>@{ Name = 'Item 1' } | Test-PSRuleTarget;</dev:code> <dev:remarks> <maml:para>Evaluate a simple hashtable on the pipeline against rules loaded from the current working path.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://berniewhite.github.io/PSRule/commands/PSRule/en-US/Test-PSRuleTarget.html</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-PSRule</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSRule</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |