Skip to content

CLI: --directory option for the remote working directory (winrs -d) #138

Description

@bertysentry

winrs parity: -d[irectory]:PATH — starting directory for the remote shell.

Context

The fluent API already supports this — CommandRequest.workingDirectory(String), honored when the remote shell is created (the client's first command) — but the CLI does not expose it: a CLI run always starts in %USERPROFILE%.

Proposal

winrm-java -h server -u 'DOMAIN\user' -pf pw.txt \
  -d 'C:\build' exec build.cmd

Acceptance criteria

  • Option parsed and passed through to the request; wire assertion that the Create shell request carries rsp:WorkingDirectory (FakeWsmanServer).
  • Usage error when the value is missing or blank.
  • Documented in the CLI manual options table.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions