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

Description

The names of computers should never be hard coded as this will expose sensitive information. The ComputerName parameter should never have a hard coded value.

How

Remove hard coded computer names.

Example 1

Problematic code

Correct code

Example 2

Problematic code

Correct code

Source

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