Changes

Windows PowerShell 1.0 Functions

295 bytes added, 19:40, 4 December 2008
Function Parameter Initialization
<pre>
function names ($firstname = "Not Specified", $lastname = "Unknown")
{
"First name is $firstname"
"Last name is $lastname"
}
</pre>
When executed with insufficient parameters, the default value is values are assigned:
<pre>
PS C:\Users\Administrator> names
First name is Not Specified
Last name is Unknown
 
PS C:\Users\Administrator> names john
First name is john
Last name is Unknown
</pre>