Skip to main content
powershell/PSAvoidUsingDeprecatedManifestFields is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
tally disables this rule by default because Dockerfiles do not ship PowerShell module manifests (.psd1 files) — this rule targets module-authoring artifacts that are out of scope for container builds. Re-enable it with include = ["powershell/PSAvoidUsingDeprecatedManifestFields"] or by setting rules.powershell.PSAvoidUsingDeprecatedManifestFields.severity = "warning" in .tally.toml.

Description

In PowerShell 5.0, a number of fields in module manifest files (.psd1) have been changed. The field ModuleToProcess has been replaced with the RootModule field.

How

Replace ModuleToProcess with RootModule in the module manifest.

Examples

Problematic code

Correct code

Source

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