{"id":2831,"date":"2010-09-03T17:50:35","date_gmt":"2010-09-03T17:50:35","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2010\/09\/03\/designing-cmdlets-that-have-lots-of-parameters\/"},"modified":"2019-02-18T13:05:52","modified_gmt":"2019-02-18T20:05:52","slug":"designing-cmdlets-that-have-lots-of-parameters","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/designing-cmdlets-that-have-lots-of-parameters\/","title":{"rendered":"Designing Cmdlets That Have Lots of Parameters"},"content":{"rendered":"<p>We often get the question of what to do about a cmdlet that has lots of parameters.&#160; Do you break it up into multiple commands or just have a single cmdlet with lots of parameters.&#160; Here is the way I think about it:<\/p>\n<p>If you have to enter 100 things to get a job done, it doesn\u2019t really matter whether you enter those 100 things via 1 cmdlet with 100 parameters or 10 cmdlets with 10 parameters each.&#160; If anything, there are a number of good reasons to have 1 cmdlet with 100 parameters including the fact that you don\u2019t have to enter 10 cmdlets and you produce an abstraction which is much more friendly to being exposed as a REST API.<\/p>\n<p>Let me be quick to point out the trick \u2013 that is all about if you have to enter 100 things to do something.&#160; Most often that is not the situation we find ourselves in.&#160; Often is the case that you can specify 100 things but 80% of the scenarios are handled by 20 parameters.&#160; That is a very different situation.&#160; Let\u2019s look at New-PSSession for an example.&#160; New-PSSession takes a number (14) of useful parameters like \u2013ComputerName, \u2013Port, \u2013Credential, \u2013UseSSL etc.&#160; It also takes a parameters called \u2013SessionOption.&#160; Let\u2019s look at that:<\/p>\n<p><font face=\"Consolas\">PS&gt; <strong>Get-Help New-PSSession -Parameter SessionOption<\/strong><\/font><\/p>\n<p><font face=\"Consolas\">-SessionOption &lt;PSSessionOption&gt;     <br \/>&#160;&#160;&#160; Sets advanced options for the session.&#160; Enter a SessionOption object that y      <br \/>&#160;&#160;&#160; ou create by using the New-PSSessionOption cmdlet.<\/font><\/p>\n<p><font face=\"Consolas\">&#160;&#160;&#160; The default values for the options are determined by the value of the $PSSe     <br \/>&#160;&#160;&#160; ssionOption preference variable, if it is set. Otherwise, the session uses      <br \/>&#160;&#160;&#160; the system defaults.<\/font><\/p>\n<p><font face=\"Consolas\">&#160;&#160;&#160; For a description of the session options, including the default values, see     <br \/>&#160;&#160;&#160;&#160; New-PSSessionOption. For information about the $PSSessionOption preference      <br \/>&#160;&#160;&#160;&#160; variable, see about_Preference_Variables.<\/font><\/p>\n<p><font face=\"Consolas\">&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false     <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/><\/font><\/p>\n<p>&#160;<\/p>\n<p>So the way you get an object to pass to \u2013SessionOption is by calling the New-PSSessionOption cmdlet.&#160; That cmdlet takes 20 parameters!&#160; So why not just put those parameters on New-PSSession?&#160; Well, if you did that then when you looked at the help for New-PSSession, it would have 34 parameters that you\u2019d have to read through and when you did tab-completion, you\u2019d cycle through 34 values instead of 14.&#160; <\/p>\n<p>We put the parameters that we felt would cover 80% of the scenarios in New-PSSession and then put the rest of the parameters in New-PSSesssionOption.&#160; (In all honesty I think there are a few parameters in New-PSSession that belong in New-PSSessionOption.).<\/p>\n<p>I consider this to be a best practice because it makes it easier for admins to learn the cmdlets while still being able to cover the full range of functions.<\/p>\n<p><strong><font color=\"#ff0000\">NOTE<\/font><\/strong> \u2013 for reasons that will become apparent in the future, it is critical that the object that contains the&#160; extra parameters have a NULL-CONSTRUCTOR which initializes the object with the default values.&#160; Don\u2019t bother trying to get a sneak preview of the future by asking me to explain what will happen in the future \u2013 just take my word for it \u2013 objects will Null-Constructors are good things.<\/p>\n<p>That ends the blog but I\u2019ve included the help for the parameters of New-PSSessionOption below for those people who are interested.<\/p>\n<p>Enjoy!<\/p>\n<p>Jeffrey Snover [MSFT]   <br \/>Distinguished Engineer    <br \/><font face=\"Consolas\"><\/font><\/p>\n<p><font face=\"Consolas\"><\/font><\/p>\n<p><font face=\"Consolas\">PS&gt; Get-Help New-PSSessionOption -Parameter *<\/font><\/p>\n<p><font face=\"Consolas\">-ApplicationArguments &lt;PSPrimitiveDictionary&gt;     <br \/>&#160;&#160;&#160; Specifies a hash table that is sent directly to the session configuration w      <br \/>&#160;&#160;&#160; ithout interpretation. This hash table is available to the session configur      <br \/>&#160;&#160;&#160; ation as a property of the PSSenderInfo class.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-CancelTimeOut &lt;int&gt;     <br \/>&#160;&#160;&#160; Determines how long Windows PowerShell waits for a cancel operation (CTRL +      <br \/>&#160;&#160;&#160;&#160; C)&#160; to complete before terminating it. Enter a value in milliseconds.       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; The default value is 60000 (one minute). A value of 0 (zero) means no timeo      <br \/>&#160;&#160;&#160; ut; the command continues indefinitely.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 60000      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-Culture &lt;CultureInfo&gt;     <br \/>&#160;&#160;&#160; Specifies the culture to use for the PSSession. Enter a culture name in &lt;la      <br \/>&#160;&#160;&#160; nguagecode2&gt;-&lt;country\/regioncode2&gt; format, such as &quot;ja-jP&quot;,&#160; a variable tha      <br \/>&#160;&#160;&#160; t contains a CultureInfo object, or a command that gets a CultureInfo objec      <br \/>&#160;&#160;&#160; t, such as &quot;get-culture&quot;.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; The default value is $null, and the culture that is set in the operating sy      <br \/>&#160;&#160;&#160; stem when the PSSession is created is used in the PSSession.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Current culture      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-IdleTimeOut &lt;int&gt;     <br \/>&#160;&#160;&#160; Determines how long the PSSession stays open if the remote computer does no      <br \/>&#160;&#160;&#160; t receive any communication from the local computer, including the heartbea      <br \/>&#160;&#160;&#160; t signal. When the interval expires, the PSSession closes.       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Enter a value in milliseconds. The default value is 240000 (4 minutes). The      <br \/>&#160;&#160;&#160;&#160; minimum value is 60000 (1 minute).       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; If both the local and remote computers specify an idle timeout value, the P      <br \/>&#160;&#160;&#160; SSession uses the shorter timeout value. The local computer can set an idle      <br \/>&#160;&#160;&#160;&#160; timeout value by using this parameter or by setting an idle timeout in the      <br \/>&#160;&#160;&#160;&#160; $PSSessionOption preference variable. The remote computer can specify an i      <br \/>&#160;&#160;&#160; dle timeout value in the WS-Management configuration (WSMAN:\\localhost\\shel      <br \/>&#160;&#160;&#160; l\\idletimeout).      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 240000      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-MaximumReceivedDataSizePerCommand &lt;int&gt;     <br \/>&#160;&#160;&#160; Specifies the maximum number of bytes that the local computer can receive f      <br \/>&#160;&#160;&#160; rom the remote computer in a single command. Enter a value in bytes. By def      <br \/>&#160;&#160;&#160; ault, there is no data size limit.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; This option is designed to protect the resources on the client computer.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; No limit      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-MaximumReceivedObjectSize &lt;int&gt;     <br \/>&#160;&#160;&#160; Specifies the maximum size of an object that the local computer can receive      <br \/>&#160;&#160;&#160;&#160; from the remote computer. Enter a value in bytes. By default, there is no       <br \/>&#160;&#160;&#160; data size limit.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; This option is designed to protect the resources on the client computer.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; No limit      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-MaximumRedirection &lt;int&gt;     <br \/>&#160;&#160;&#160; Determines how many times Windows PowerShell redirects a connection to an a      <br \/>&#160;&#160;&#160; lternate Uniform Resource Identifier (URI) before the connection fails. The      <br \/>&#160;&#160;&#160;&#160; default value is 5. A value of 0 (zero) prevents all redirection.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; This option is used in the PSSession only when the AllowRedirection paramet      <br \/>&#160;&#160;&#160; er is used in the command that creates the PSSession.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 5      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-NoCompression [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Turns off packet compression in the PSSession. Compression uses more proces      <br \/>&#160;&#160;&#160; sor cycles, but it makes transmission faster.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-NoEncryption [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Turns off data encryption.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-NoMachineProfile [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Prevents loading the user&#8217;s Windows user profile. As a result, the PSSessio      <br \/>&#160;&#160;&#160; n might be created faster, but user-specific registry settings, items such       <br \/>&#160;&#160;&#160; as environment variables, and certificates are not available in the PSSessi      <br \/>&#160;&#160;&#160; on.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-OpenTimeOut &lt;int&gt;     <br \/>&#160;&#160;&#160; Determines how long the client computer waits for the session connection to      <br \/>&#160;&#160;&#160;&#160; be established. When the interval expires, the command to establish the co      <br \/>&#160;&#160;&#160; nnection fails. Enter a value in milliseconds.       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; The default value is 180000 (3 minutes). A value of 0 (zero) means no time-      <br \/>&#160;&#160;&#160; out; the command continues indefinitely.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 180000      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-OperationTimeOut &lt;int&gt;     <br \/>&#160;&#160;&#160; Determines the maximum time that any operation in the PSSession can run. Wh      <br \/>&#160;&#160;&#160; en the interval expires, the operation fails. Enter a value in milliseconds      <br \/>&#160;&#160;&#160; .       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; The default value is 180000 (3 minutes). A value of 0 (zero) means no time-      <br \/>&#160;&#160;&#160; out; the operation continues indefinitely.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 180000      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-ProxyAccessType &lt;ProxyAccessType&gt;     <br \/>&#160;&#160;&#160; Determines which mechanism is used to resolve the host name. Valid values a      <br \/>&#160;&#160;&#160; re IEConfig, WinHttpConfig, AutoDetect, NoProxyServer and None. The default      <br \/>&#160;&#160;&#160;&#160; value is None.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; For information about the values of this parameter, see the description of       <br \/>&#160;&#160;&#160; the System.Management.Automation.Remoting.ProxyAccessType enumeration in th      <br \/>&#160;&#160;&#160; e MSDN (Microsoft Developer Network) Library at &lt;a href=&quot;http:\/\/go.microsoft.com\/fwl&quot;&gt;http:\/\/go.microsoft.com\/fwl&lt;\/a&gt;      <br \/>&#160;&#160;&#160; ink\/?LinkId=144756.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; None      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-ProxyAuthentication &lt;AuthenticationMechanism&gt;     <br \/>&#160;&#160;&#160; Specifies the authentication method that is used for proxy resolution. Vali      <br \/>&#160;&#160;&#160; d values are Basic, Digest, and Negotiate. The default value is Negotiate.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; For information about the values of this parameter, see the description of       <br \/>&#160;&#160;&#160; the System.Management.Automation.Runspaces.AuthenticationMechanism enumerat      <br \/>&#160;&#160;&#160; ion in the MSDN library at &lt;a href=&quot;http:\/\/go.microsoft.com\/fwlink\/?LinkID=144382&quot;&gt;http:\/\/go.microsoft.com\/fwlink\/?LinkID=144382&lt;\/a&gt;.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Negotiate      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-ProxyCredential &lt;PSCredential&gt;     <br \/>&#160;&#160;&#160; Specifies the credentials to use for proxy authentication. Enter a variable      <br \/>&#160;&#160;&#160;&#160; that contains a PSCredential object or a command that gets a PSCredential       <br \/>&#160;&#160;&#160; object, such as Get-Credential. If this option is not set, no credentials a      <br \/>&#160;&#160;&#160; re specified.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; None      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-SkipCACheck [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Specifies that when connecting over HTTPS, the client does not validate tha      <br \/>&#160;&#160;&#160; t the server certificate is signed by a trusted certificate authority (CA).      <br \/>&#160;&#160;&#160;&#160; <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Use this option only when the remote computer is trusted by using another m      <br \/>&#160;&#160;&#160; echanism, such as when the remote computer is part of a network that is phy      <br \/>&#160;&#160;&#160; sically secure and isolated, or the remote computer is listed as a trusted       <br \/>&#160;&#160;&#160; host in a WinRM configuration.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-SkipCNCheck [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Specifies that the certificate common name (CN) of the server does not need      <br \/>&#160;&#160;&#160;&#160; to match the hostname of the server. This option is used only in remote op      <br \/>&#160;&#160;&#160; erations that use the HTTPS protocol.       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Use this option only for trusted computers.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-SkipRevocationCheck [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Does not validate the revocation status of the server certificate.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-UICulture &lt;CultureInfo&gt;     <br \/>&#160;&#160;&#160; Specifies the UI culture to use for the PSSession.       <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Enter a culture name in &lt;languagecode2&gt;-&lt;country\/regioncode2&gt; format, such       <br \/>&#160;&#160;&#160; as &quot;ja-jP&quot;,&#160; a variable that contains a CultureInfo object, or a command th      <br \/>&#160;&#160;&#160; at gets a CultureInfo object, such as Get-Culture.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; The default value is $null, and the UI culture that is set in the operating      <br \/>&#160;&#160;&#160;&#160; system when the PSSession is created is used in the PSSession.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Current UI culture      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n<p><font face=\"Consolas\">-UseUTF16 [&lt;SwitchParameter&gt;]     <br \/>&#160;&#160;&#160; Encode the request in UTF16 format rather than UTF8 format.      <br \/>&#160;&#160;&#160; <br \/>&#160;&#160;&#160; Required?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Position?&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; named      <br \/>&#160;&#160;&#160; Default value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False (UTF8 encoding)      <br \/>&#160;&#160;&#160; Accept pipeline input?&#160;&#160;&#160;&#160;&#160;&#160; false      <br \/>&#160;&#160;&#160; Accept wildcard characters?&#160; false      <br \/>&#160;&#160;&#160; <\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We often get the question of what to do about a cmdlet that has lots of parameters.&#160; Do you break it up into multiple commands or just have a single cmdlet with lots of parameters.&#160; Here is the way I think about it: If you have to enter 100 things to get a job done, [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>We often get the question of what to do about a cmdlet that has lots of parameters.&#160; Do you break it up into multiple commands or just have a single cmdlet with lots of parameters.&#160; Here is the way I think about it: If you have to enter 100 things to get a job done, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/2831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=2831"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/2831\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=2831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=2831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=2831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}