Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt

Use this file to discover all available pages before exploring further.

powershell/PSUseCmdletCorrectly is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
PropertyValue
SeverityWarning
CategoryPSScriptAnalyzer
Auto-fixNo

Description

Whenever we call a command, care should be taken that it is invoked with the correct syntax and parameters.

How

Specify all mandatory parameters when calling commands.

Examples

Problematic code

Function Set-TodaysDate ()
{
    Set-Date
    ...
}

Correct code

Function Set-TodaysDate ()
{
    $date = Get-Date
    Set-Date -Date $date
    ...
}

Source

This rule documentation is adapted from Microsoft’s PSScriptAnalyzer documentation for UseCmdletCorrectly, licensed under CC BY 4.0.