November 2018
Intermediate to advanced
566 pages
17h 15m
English
Sometimes, it is possible to assign a default value to a parameter so that the administrators do not have to necessarily specify any value to it when calling the cmdlet. One of the examples for this is the ResultSize parameter in the Get-Mailbox cmdlet in Microsoft Exchange. By default, calling Get-Mailbox without any parameter would return 1,000 mailboxes.
The default value, of course, can be overridden by explicitly specifying a value for the parameter when calling the function. Let's say we're running the following code:
PS> Start-Count
This would count to 10. To override this behavior—to, say, make the function count to 4—you would call the following:
PS> Start-Count -to 4
Do not make the parameter mandatory if it has ...
Read now
Unlock full access