8000 PSUseCorrectCasing malfunctioning in DSC configuration · Issue #1474 · PowerShell/PSScriptAnalyzer · GitHub
[go: up one dir, main page]

Skip to content

PSUseCorrectCasing malfunctioning in DSC configuration #1474

@xtqqczze

Description

@xtqqczze

PSUseCorrectCasing is erroneously changing Type to type in a DSC configuration.

Steps to reproduce

$settings = @{
    IncludeRules = @("PSUseCorrectCasing")
    Rules = @{
        PSUseCorrectCasing = @{
            Enable = $true
        }
    }
}

Invoke-Formatter -Settings $settings -ScriptDefinition @'
Configuration ApacheServer{
    Node localhost{
         nxFile vHostDirectory{
             DestinationPath = $VhostDir
             Type = "Directory"
             Ensure = "Present"
             Owner = "root"
             Mode = "744"
         }
     }
 }
'@

Expected behavior

Configuration ApacheServer{
    Node localhost{
         nxFile vHostDirectory{
             DestinationPath = $VhostDir
             Type = "Directory"
             Ensure = "Present"
             Owner = "root"
             Mode = "744"
         }
     }
 }

Actual behavior

Configuration ApacheServer{
    Node localhost{
         nxFile vHostDirectory{
             DestinationPath = $VhostDir
             type = "Directory"
             Ensure = "Present"
             Owner = "root"
             Mode = "744"
         }
     }
 }

Environment data

> $PSVersionTable
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.19.0
1.18.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0