SplattyPS-help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns="http://msh" schema="maml"> <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-SplattedCommand</command:name> <command:verb>Get</command:verb> <command:noun>SplattedCommand</command:noun> <maml:description><maml:para>Generate a splatted command invocation for the specified command. </maml:para> </maml:description> </command:details> <maml:description><maml:para>Generate a splatted command invocation for the specified command. </maml:para> </maml:description> <command:syntax><command:syntaxItem><maml:name>Get-SplattedCommand</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"><maml:name>Name</maml:name> <maml:Description><maml:para>Name of the command. </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="True (ByPropertyName)" position="1" aliases="htn"><maml:name>HashTableName</maml:name> <maml:Description><maml:para>Name of the hash table used for splatting. </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="All"><maml:name>AllParameters</maml:name> <maml:Description><maml:para>Include both mandatory and optional paramers. </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="True (ByPropertyName)" position="named" aliases="avn"><maml:name>AssignmentVariableName</maml:name> <maml:Description><maml:para>The name of a variable to assign the result of invoking the command. </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="c"><maml:name>CompactHashTable</maml:name> <maml:Description><maml:para>Emit a single line hash table. (Not really a good idea :)) </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="esb"><maml:name>EmitScriptBlock</maml:name> <maml:Description><maml:para>Emits a script block. </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="ILoveSemis"><maml:name>ILoveSemiColons</maml:name> <maml:Description><maml:para>If specifed all (non-blank) lines are terminated with a semi-colon. </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="icp"><maml:name>IncludeCommonParameters</maml:name> <maml:Description><maml:para>Includes common parameters (if the command suport them) </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="il"><maml:name>IndentLevel</maml:name> <maml:Description><maml:para>Initial indent level. Default 0. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</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="is"><maml:name>IndentSize</maml:name> <maml:Description><maml:para>The number of characters for each indent. Default 4 with spaces, default 1 with tabs. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</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="ps"><maml:name>ParameterSet</maml:name> <maml:Description><maml:para>The parameter set to use. </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="ra"><maml:name>ResolveAlias</maml:name> <maml:Description><maml:para>Emit the command name instead of an alias, if an alias was specified. </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="ut, nooooo"><maml:name>UseTabs</maml:name> <maml:Description><maml:para>Emit Tabs instead of spaces. </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:syntaxItem><maml:name>Get-SplattedCommand</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"><maml:name>Name</maml:name> <maml:Description><maml:para>Name of the command. </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="True (ByPropertyName)" position="1" aliases="htn"><maml:name>HashTableName</maml:name> <maml:Description><maml:para>Name of the hash table used for splatting. </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="All"><maml:name>AllParameters</maml:name> <maml:Description><maml:para>Include both mandatory and optional paramers. </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="True (ByPropertyName)" position="named" aliases="avn"><maml:name>AssignmentVariableName</maml:name> <maml:Description><maml:para>The name of a variable to assign the result of invoking the command. </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="esb"><maml:name>EmitScriptBlock</maml:name> <maml:Description><maml:para>Emits a script block. </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="ILoveSemis"><maml:name>ILoveSemiColons</maml:name> <maml:Description><maml:para>If specifed all (non-blank) lines are terminated with a semi-colon. </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="icp"><maml:name>IncludeCommonParameters</maml:name> <maml:Description><maml:para>Includes common parameters (if the command suport them) </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="il"><maml:name>IndentLevel</maml:name> <maml:Description><maml:para>Initial indent level. Default 0. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</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="is"><maml:name>IndentSize</maml:name> <maml:Description><maml:para>The number of characters for each indent. Default 4 with spaces, default 1 with tabs. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</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="ps"><maml:name>ParameterSet</maml:name> <maml:Description><maml:para>The parameter set to use. </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="ra"><maml:name>ResolveAlias</maml:name> <maml:Description><maml:para>Emit the command name instead of an alias, if an alias was specified. </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="sth"><maml:name>ShowTypeHint</maml:name> <maml:Description><maml:para>Emit a type hint for each 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="ut, nooooo"><maml:name>UseTabs</maml:name> <maml:Description><maml:para>Emit Tabs instead of spaces. </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="named" aliases="All"><maml:name>AllParameters</maml:name> <maml:Description><maml:para>Include both mandatory and optional paramers. </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="True (ByPropertyName)" position="named" aliases="avn"><maml:name>AssignmentVariableName</maml:name> <maml:Description><maml:para>The name of a variable to assign the result of invoking the command. </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="c"><maml:name>CompactHashTable</maml:name> <maml:Description><maml:para>Emit a single line hash table. (Not really a good idea :)) </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="esb"><maml:name>EmitScriptBlock</maml:name> <maml:Description><maml:para>Emits a script block. </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="True (ByPropertyName)" position="1" aliases="htn"><maml:name>HashTableName</maml:name> <maml:Description><maml:para>Name of the hash table used for splatting. </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="ILoveSemis"><maml:name>ILoveSemiColons</maml:name> <maml:Description><maml:para>If specifed all (non-blank) lines are terminated with a semi-colon. </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="icp"><maml:name>IncludeCommonParameters</maml:name> <maml:Description><maml:para>Includes common parameters (if the command suport them) </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="il"><maml:name>IndentLevel</maml:name> <maml:Description><maml:para>Initial indent level. Default 0. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</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="is"><maml:name>IndentSize</maml:name> <maml:Description><maml:para>The number of characters for each indent. Default 4 with spaces, default 1 with tabs. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type><maml:name>Int32</maml:name> <maml:uri /></dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"><maml:name>Name</maml:name> <maml:Description><maml:para>Name of the command. </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="ps"><maml:name>ParameterSet</maml:name> <maml:Description><maml:para>The parameter set to use. </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="ra"><maml:name>ResolveAlias</maml:name> <maml:Description><maml:para>Emit the command name instead of an alias, if an alias was specified. </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="sth"><maml:name>ShowTypeHint</maml:name> <maml:Description><maml:para>Emit a type hint for each 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="ut, nooooo"><maml:name>UseTabs</maml:name> <maml:Description><maml:para>Emit Tabs instead of spaces. </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:inputType><dev:type><maml:name>System.String</maml:name> </dev:type> <maml:description><maml:para> </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues><command:returnValue><dev:type><maml:name>System.String</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 Get a splatted command</maml:title> <dev:code>$Params = @{ Name = #mandatory } Get-SplattedCommand @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 2 Get a splatted command with all parameters</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -AllParameters $Params = @{ Name = #mandatory HashTableName = #optional ParameterSet = #optional AllParameters = #optional IncludeCommonParameters = #optional EmitScriptBlock = #optional ShowTypeHint = #optional CompactHashTable = #optional ILoveSemiColons = #optional IndentSize = #optional IndentLevel = #optional UseTabs = #optional ResolveAlias = #optional AssignmentVariableName = #optional } Get-SplattedCommand @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 3 Get a splatted command with all parameters and common parameters</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -AllParameters -IncludeCommonParameters $Params = @{ Name = #mandatory HashTableName = #optional ParameterSet = #optional AllParameters = #optional IncludeCommonParameters = #optional EmitScriptBlock = #optional ShowTypeHint = #optional CompactHashTable = #optional ILoveSemiColons = #optional IndentSize = #optional IndentLevel = #optional UseTabs = #optional ResolveAlias = #optional AssignmentVariableName = #optional Verbose = #optional Debug = #optional ErrorAction = #optional WarningAction = #optional InformationAction = #optional ErrorVariable = #optional WarningVariable = #optional InformationVariable = #optional OutVariable = #optional OutBuffer = #optional PipelineVariable = #optional } Get-SplattedCommand @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 4 Specify the name of the splattable hashtable</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -HashTableName 'SplattedParams' $SplattedParams = @{ Name = #mandatory } Get-SplattedCommand @SplattedParams PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 5 Assign the result to a variable</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -AssignmentVariableName 'Result' $Params = @{ Name = #mandatory } $Result = Get-SplattedCommand @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 6 Get a splattable command in a script block</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -AssignmentVariableName 'Result' -EmitScriptBlock Invoke-Command { $Params = @{ Name = #mandatory } $Result = Get-SplattedCommand @Params } PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 7 Get a type hint for each parameter</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-SplattedCommand -ShowTypeHint $Params = @{ Name = #mandatory System.String } Get-SplattedCommand @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> <command:example><maml:title>Example 8 Specify a parameter set</maml:title> <dev:code>PS C:\> Get-SplattedCommand Get-Help -ParameterSet Online $Params = @{ Online = #mandatory } Get-Help @Params PS C:\> PS C:\> Get-SplattedCommand Get-Help -ParameterSet Examples $Params = @{ Examples = #mandatory } Get-Help @Params PS C:\></dev:code> <dev:remarks><maml:para> </maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/stvnrs/splattyps/wiki/Get-a-splatted-command</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |