Skip to content

Feat/powershell -e encode decode - #2702

Open
Ne0re0 wants to merge 3 commits into
gchq:masterfrom
Ne0re0:feat/powershell-encode-decode
Open

Feat/powershell -e encode decode#2702
Ne0re0 wants to merge 3 commits into
gchq:masterfrom
Ne0re0:feat/powershell-encode-decode

Conversation

@Ne0re0

@Ne0re0 Ne0re0 commented Jul 30, 2026

Copy link
Copy Markdown

Description

Adds a new PowerShell -e Encode/Decode.

powershell -e parameter expects the command to be encoded as UTF-16LE + Base64. Those 2 encodings have to be chained manually which is not really fun to set back every time. So this adds encoding/decoding as a single block.

Examples :

  • Encode: whoamidwBoAG8AYQBtAGkA, runnable as powershell -e dwBoAG8AYQBtAGkA.
  • Decode: dwBoAG8AYQBtAGkAwhoami.

Existing Issue

N/A

Screenshots

N/A

AI disclosure

This code was written with the assistance of Claude Opus 4.8 (via Claude Code). I have reviewed the code, understand how it works, and take full responsibility for it.

Test Coverage

Test coverage is included in tests/operations/tests/PowerShellEncodeDecode.mjs, covering:

  • encoding an empty input,
  • encoding a known command (whoamidwBoAG8AYQBtAGkA),
  • decoding that same value back,
  • a round-trip (encode → decode) of a more complex command containing spaces and special characters.

All operation tests pass locally (npm test).

@CLAassistant

CLAassistant commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants