Skip to main content
powershell/PSUseCmdletCorrectly is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

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

Correct code

Source

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