SeeminglyScience / EditorServicesCommandSuite

Collection of editor commands for use in PowerShell Editor Services.
Other
152 stars 13 forks source link

Setting switch to false is ignored #61

Closed PrzemyslawKlys closed 3 years ago

PrzemyslawKlys commented 4 years ago

Converting switch with $false is ignored

Get-ChildItem -Filter 'Test' -Verbose:$false

Probably related to: https://github.com/SeeminglyScience/EditorServicesCommandSuite/issues/56

SeeminglyScience commented 3 years ago

Unfortunately nothing I can do about this. The API System.Management.Automation.StaticParameterBinder does not report this parameter as bound.

Example:

$result = [Management.Automation.Language.StaticParameterBinder]::BindCommand(
    { Get-ChildItem -Filter 'Test' -Verbose:$false }.Ast.EndBlock.Statements[0].PipelineElements[0],
    <# resolve: #> $true)

$result.BoundParameters

Returns:

Key    Value
---    -----
Filter System.Management.Automation.Language.ParameterBindingResult