FormatPowershellCode icon indicating copy to clipboard operation
FormatPowershellCode copied to clipboard

Format-ScriptExpandParameterBlocks deletes comments

Open Vikimania opened this issue 7 years ago • 0 comments

Hi Zachary Loeber, nice formatting script for Powershell. I just found a bug I guess. It would be great if you can fix that as comments shouldn't be deleted. I just provide you here with a simple example:

Get-Content test.ps1 -raw | Format-ScriptExpandParameterBlocks | clip

test.ps1 consists of: Param ( # Information type of log entry [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0, ParameterSetName = 'Info')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [Alias("information")] [System.String]$Info)

After formatting: param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0, ParameterSetName = 'Info')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [Alias("information")] [System.String]$Info )

The comment is deleted. Can you please fix that?

Thanks Viki

Vikimania avatar Nov 21 '18 17:11 Vikimania