PsIni icon indicating copy to clipboard operation
PsIni copied to clipboard

-IgnoreComments do not work

Open MarkStephan89 opened this issue 3 years ago • 1 comments

Hi, I test the IgnoreComments, but it do not work

I test these: Get-IniContent (-FilePath "C:\temp\abc.ini" -IgnoreComments) Get-IniContent (-FilePath "C:\temp\abc.ini" -IgnoreComments $true)

Thanks :)

MarkStephan89 avatar Mar 09 '22 06:03 MarkStephan89

You need to remove the parentheses (). Get-IniContent -FilePath "C:\temp\abc.ini" -IgnoreComments

If a switch is present on the command it's $true, If it's not, it's $false. It is possible to set the value explicitly: Get-IniContent -FilePath "C:\temp\abc.ini" -IgnoreComments:$true or you can do it with a variable:

[bool]$commentYN=$false
Get-IniContent -FilePath "C:\temp\abc.ini" -IgnoreComments:$commentYN

For future questions: it would be helpful if you also include the error you get or the output from the command.

nlsdg avatar Sep 18 '22 07:09 nlsdg