en-US/PSFluentObjectValidation-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>Assert-Exist</command:name> <command:verb>Assert</command:verb> <command:noun>Exist</command:noun> <maml:description> <maml:para>Asserts the existence and validity of a property within an object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Assert-Exist` function validates the existence of a property within an object and ensures it meets the specified validation criteria. If the validation fails, it throws a detailed exception, making it suitable for scenarios where strict validation is required.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Assert-Exist</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="In"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The object to validate. This can be a hashtable, PSObject, .NET object, or any other object type.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</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="2" aliases="With, Test"> <maml:name>Key</maml:name> <maml:description> <maml:para>The property path to validate. Supports fluent syntax with validation operators: - `property.nested` - Basic navigation</maml:para> <maml:para>- `property!` - Non-empty validation (rejects null/empty/whitespace)</maml:para> <maml:para>- `property?` - Existence validation (allows null values)</maml:para> <maml:para>- `array[0]` - Array indexing</maml:para> <maml:para>- `array[*]` - Wildcard validation (all elements must pass)</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="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="In"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The object to validate. This can be a hashtable, PSObject, .NET object, or any other object type.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</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="2" aliases="With, Test"> <maml:name>Key</maml:name> <maml:description> <maml:para>The property path to validate. Supports fluent syntax with validation operators: - `property.nested` - Basic navigation</maml:para> <maml:para>- `property!` - Non-empty validation (rejects null/empty/whitespace)</maml:para> <maml:para>- `property?` - Existence validation (allows null values)</maml:para> <maml:para>- `array[0]` - Array indexing</maml:para> <maml:para>- `array[*]` - Wildcard validation (all elements must pass)</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="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para>Throws an exception if the validation fails. Use `Test-Exist` for a non-throwing alternative.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Assert-Exist -InputObject $data -Key "user.name!"</dev:code> <dev:remarks> <maml:para>Asserts that the `user.name` property exists and is non-empty</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>Assert-Exist -InputObject $data -Key "users[*].email!"</dev:code> <dev:remarks> <maml:para>Asserts that all users in the array have a non-empty email</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>Assert-Exist -InputObject $data -Key "settings.theme"</dev:code> <dev:remarks> <maml:para>Asserts that the `settings.theme` property exists</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>https://www.pwshdevs.com/</maml:linkText> <maml:uri>https://www.pwshdevs.com/</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-Exist</command:name> <command:verb>Test</command:verb> <command:noun>Exist</command:noun> <maml:description> <maml:para>Tests the existence and validity of a property within an object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Test-Exist` function validates the existence of a property within an object and ensures it meets the specified validation criteria. Unlike `Assert-Exist`, this function does not throw exceptions; instead, it returns a boolean value indicating whether the validation passed.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-Exist</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="In"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The object to validate. This can be a hashtable, PSObject, .NET object, or any other object type.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</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="2" aliases="With, Test"> <maml:name>Key</maml:name> <maml:description> <maml:para>The property path to validate. Supports fluent syntax with validation operators: - `property.nested` - Basic navigation</maml:para> <maml:para>- `property!` - Non-empty validation (rejects null/empty/whitespace)</maml:para> <maml:para>- `property?` - Existence validation (allows null values)</maml:para> <maml:para>- `array[0]` - Array indexing</maml:para> <maml:para>- `array[*]` - Wildcard validation (all elements must pass)</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="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="In"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The object to validate. This can be a hashtable, PSObject, .NET object, or any other object type.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</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="2" aliases="With, Test"> <maml:name>Key</maml:name> <maml:description> <maml:para>The property path to validate. Supports fluent syntax with validation operators: - `property.nested` - Basic navigation</maml:para> <maml:para>- `property!` - Non-empty validation (rejects null/empty/whitespace)</maml:para> <maml:para>- `property?` - Existence validation (allows null values)</maml:para> <maml:para>- `array[0]` - Array indexing</maml:para> <maml:para>- `array[*]` - Wildcard validation (all elements must pass)</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="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>{{ Fill ProgressAction Description }}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para>Returns `$true` if the validation passes, `$false` otherwise. Use `Assert-Exist` for a throwing alternative.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Test-Exist -InputObject $data -Key "user.name!"</dev:code> <dev:remarks> <maml:para>Tests that the `user.name` property exists and is non-empty.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>Test-Exist -InputObject $data -Key "users[*].email!"</dev:code> <dev:remarks> <maml:para>Tests that all users in the array have a non-empty email.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>Test-Exist -InputObject $data -Key "settings.theme"</dev:code> <dev:remarks> <maml:para>Tests that the `settings.theme` property exists.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>https://www.pwshdevs.com/</maml:linkText> <maml:uri>https://www.pwshdevs.com/</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |