SeeminglyScience / EditorServicesCommandSuite

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

Switch IsPresent is converted to $true automatically on Splat conversion #56

Closed PrzemyslawKlys closed 3 years ago

PrzemyslawKlys commented 4 years ago

It seems that ConvertToSplat does automatic conversion to $true when you use something along the lines


function Test {
    param(
        [switch] $Test
    )
    Test -Test:$Test.IsPresent
}

to


function Test {
    param(
        [switch] $Test
    )
    $testSplat = @{
        Test = $true
    }
    Test @testSplat
}