SeeminglyScience / EditorServicesCommandSuite

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

ConvertTo-SplatExpression Creates Invalid Variable Names when using FQCN #39

Closed markekraus closed 4 years ago

markekraus commented 5 years ago

Assume you have the following command:

Microsoft.PowerShell.Management\New-Item -Path $Path -ItemType Directory -Force

Running ConvertTo-SplatExpression on that line creates a variable named $microsoft.PowerShell.Management\NewItemSplat which is definitely not a valid variable name.

Full transformation:

$microsoft.PowerShell.Management\NewItemSplat = @{
    Path = $Path
    ItemType = 'Directory'
    Force = $true
}
Microsoft.PowerShell.Management\New-Item @microsoft.PowerShell.Management\NewItemSplat
SeeminglyScience commented 4 years ago

Fixed with v1.0.0-beta1

Install-Module EditorServicesCommandSuite -Scope CurrentUser -AllowPrerelease -Force