Skip to content

Parse PowerShell user agent and match as CLI - #205

Open
kimsondrup wants to merge 1 commit into
mpolden:masterfrom
kimsondrup:feature/powershell
Open

kimsondrup wants to merge 1 commit into
mpolden:masterfrom
kimsondrup:feature/powershell

Conversation

@kimsondrup

@kimsondrup kimsondrup commented Sep 20, 2026 •

Copy link
Copy Markdown

PowerShell's Invoke-WebRequest and Invoke-RestMethod send a browser-like,
Mozilla-prefixed User-Agent with their own product appended last:

Mozilla/5.0 (Linux; Fedora Linux 44 (WSL); en-US) PowerShell/7.6.5

Parse only reads the leading product, so it returns Mozilla and PowerShell
callers get the HTML page instead of their IP. PowerShell's own tracker still has
this as an open issue: PowerShell/PowerShell#24425.
The browser-like default makes the website return interactive HTML instead of
machine-readable output.

Now Parse reports PowerShell and WindowsPowerShell (separate products) and
cliMatcher matches both. /json gets more accurate for these clients too:
product is PowerShell and version is 7.6.5, instead of a misleading
Mozilla/5.0.

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.

1 participant