en-US/Spread-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>Invoke-WithParameter</command:name> <command:verb>Invoke</command:verb> <command:noun>WithParameter</command:noun> <maml:description> <maml:para>Distribute intelligently parameters to the commands you want to run</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Runs a script block where the parameters can be declared for all or individually.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Invoke-WithParameter</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in braces ( { } ) to create a script block. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Parameter</maml:name> <maml:Description> <maml:para>Parameter and Values to use with the commands in the ScriptBlock. Parameters which can be mistaken as CommonParameters must be enclosed in quotes. PowerShell will interpret the `-Verb` as an abbreviation for `Invoke-WithParameter -Verbose` E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-Verb } -Verb "I*"</maml:para> <maml:para></maml:para> <maml:para>Parameters of type Switch (or boolean) must be declared with $true or $false. E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-ChildItem } -Recurse $true -Path ..\</maml:para> <maml:para></maml:para> <maml:para>Parameters can be declared to be used for a single command. E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-Process ; Get-Service } -"Get-Process:Name" "po*sh*" -"Get-Service:Name" "net*"</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:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in braces ( { } ) to create a script block. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Parameter</maml:name> <maml:Description> <maml:para>Parameter and Values to use with the commands in the ScriptBlock. Parameters which can be mistaken as CommonParameters must be enclosed in quotes. PowerShell will interpret the `-Verb` as an abbreviation for `Invoke-WithParameter -Verbose` E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-Verb } -Verb "I*"</maml:para> <maml:para></maml:para> <maml:para>Parameters of type Switch (or boolean) must be declared with $true or $false. E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-ChildItem } -Recurse $true -Path ..\</maml:para> <maml:para></maml:para> <maml:para>Parameters can be declared to be used for a single command. E.g.:</maml:para> <maml:para></maml:para> <maml:para>Invoke-WithParameter { Get-Process ; Get-Service } -"Get-Process:Name" "po*sh*" -"Get-Service:Name" "net*"</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:parameters> <command:inputTypes /> <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>Invoke-WithParameter { Get-Verb | Format-Wide } Column 3 Verb "I*"</dev:code> <dev:remarks> <maml:para>Description ----------- Use the parameters `-Column 3` and `-Verb I*` in both commands. All parameters that cannot be used with a command will be ignored.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>Invoke-WithParameter { Get-Verb | Format-Wide } -Column:3 -"Get-verb:Verb" "I*"</dev:code> <dev:remarks> <maml:para>Description ----------- Use the parameter `-Column 3` for both commands and `-Verb I*` only for `Get-Verb`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>$scriptblock = {Get-Verb | Format-Wide} PS C:\\\>$parameters = @{ Column = 4 "Get-Verb:Verb" = "S*" "*:Verbose" = $true } PS C:\\\>Invoke-WithParameter $scriptblock @parameters</dev:code> <dev:remarks> <maml:para>Description ----------- Use use splatting to pass the parameters. The parameters `-Column 3` and `-Verbose` will be used for both commands and `-Verb I*` will only be used for `Get-Verb`.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> </helpItems> |