Format-ScriptExpandParameterBlocks deletes 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