PowerShell / PowerShell/PSScriptAnalyzer
PSUseCorrectCasing malfunctioning in DSC configuration
Offen
Dieses Issue hat noch niemand übernommen.
Area - Formatter
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit Invoke-Formatter, der Regel PSUseCorrectCasing und der im Bericht gezeigten DSC-Konfiguration zu reproduzieren. Verfolge, wie die Regel die DSC-Eigenschaft nxFile verarbeitet, und überprüfe, dass die Formatierung Type beibehält, statt sie in type zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100