Skip to content

PSAvoidUsingCmdletAliases Detects Hashtable Key as Alias #661

@mhendric

Description

@mhendric

In the xExchange DSC module, there is a resource called xExchJetstress, which has a key value named 'Type'. When running the script analyzer against a DSC configuration script utilizing this resource, it incorrectly identifies Type as being an alias for Get-Content. Here's an example configuration:

Configuration InstallAndRunJetstress
{
Import-DscResource -Module xExchange

Node $AllNodes.NodeName
{
    #Run the Jetstress test, and evaluate the results
    xExchJetstress RunJetstress
    {
        Type            = 'Performance'
        JetstressPath   = 'C:\Program Files\Exchange Jetstress'
        JetstressParams = '/c "C:\Program Files\Exchange Jetstress\JetstressConfig.xml"'
        MinAchievedIOPS = 500
    }
}

}

Here's what the Script Analyzer outputs:

PSAvoidUsingCmdletAliases Warning 1-InstallA 64 'Type' is an alias of 'Get-Content'. Alias can introduce
ndRunJetst possible problems and make scripts hard to maintain. Please
ress.ps1 consider changing alias to its full content.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions