Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format-ScriptExpandParameterBlocks deletes comments #8

Open
Vikimania opened this issue Nov 21, 2018 · 0 comments
Open

Format-ScriptExpandParameterBlocks deletes comments #8

Vikimania opened this issue Nov 21, 2018 · 0 comments

Comments

@Vikimania
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant