Pattern: Incorrect use of cmdlet
Issue: -
Whenever we call a command, care should be taken that it is invoked with the correct syntax and parameters.
Specify all mandatory parameters when calling commands.
Example of incorrect code:
Function Set-TodaysDate ()
{
Set-Date
...
}
Example of correct code:
Function Set-TodaysDate ()
{
$date = Get-Date
Set-Date -Date $date
...
}