34,333
edits
Changes
→Function Parameter Initialization
== Function Parameter Initialization ==
In addition to allowing function parameters to be specified and assigned names, Windows PowerShell also allows those parameters to be assigned default values which will be assigned if the parameters are omitted when the function is called. The following exampleextends the ''names'' function to define default values for the ''$firstname'' and ''$lastname'' parameters: <pre></pre> When executed with insufficient parameters, the default value is assigned: <pre></pre>
== Specifying Function Parameter Types ==