Skip to content

Hashtable passed to native command should not require quotes #1761

@SteveL-MSFT

Description

@SteveL-MSFT

Jason Shirk:
Some native commands like winrm use PowerShell hashtable syntax to pass configuration options, e.g.

winrm set winrm/config/client/auth @{Basic="true"}

In this case, the PowerShell really passes

winrm set winrm/config/client/auth System.Colllections.Hashtable

If you add quotes around the hashtable, or use --%, the correct comand line is passed.

In this case, we can add a note property to the hashtable instance so we can get back the original command line, similar to what we do for other literals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-By DesignThe reported behavior is by design.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions