Steps to reproduce
Trigger a rule violation of PSAlignAssignmentStatement with unaligned assignments:
"@{`n test = 1`n test2 = 2`n}" | Set-Content -Path test.ps1
Invoke-ScriptAnalyzer -Path ./test.ps1 -Settings CodeFormattingOTBS | Select-Object -ExpandProperty SuggestedCorrections
Expected behavior
Like all other rules, the CorrectionExtent object should have the file path as File property and the correction description as Description property.
File : /path/to/test.ps1
Description : Assignment statements are not aligned
StartLineNumber : 2
StartColumnNumber : 9
EndLineNumber : 2
EndColumnNumber : 10
Text :
Lines : { }
Start : Microsoft.Windows.PowerShell.ScriptAnalyzer.Position
End : Microsoft.Windows.PowerShell.ScriptAnalyzer.Position
Actual behavior
Instead, Description is null and File contains the description.
File : Assignment statements are not aligned
Description :
StartLineNumber : 2
StartColumnNumber : 9
EndLineNumber : 2
EndColumnNumber : 10
Text :
Lines : { }
Start : Microsoft.Windows.PowerShell.ScriptAnalyzer.Position
End : Microsoft.Windows.PowerShell.ScriptAnalyzer.Position
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2
OS Ubuntu 24.04.4 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.25.0
Steps to reproduce
Trigger a rule violation of PSAlignAssignmentStatement with unaligned assignments:
Expected behavior
Like all other rules, the
CorrectionExtentobject should have the file path asFileproperty and the correction description asDescriptionproperty.Actual behavior
Instead,
Descriptionis null andFilecontains the description.Environment data