description | ms.date | ms.topic | title |
---|---|---|---|
Use Cmdlet Correctly |
06/28/2023 |
reference |
UseCmdletCorrectly |
Severity Level: Warning
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.
Function Set-TodaysDate ()
{
Set-Date
...
}
Function Set-TodaysDate ()
{
$date = Get-Date
Set-Date -Date $date
...
}