Expose default PowerShell User-Agent in Microsoft.PowerShell.Commands.PSUserAgent #23839
Labels
Issue-Enhancement
the issue is more of a feature request than a bug
Needs-Triage
The issue is new and needs to be triaged by a work group.
WG-Engine
core PowerShell engine, interpreter, and runtime
Summary of the new feature / enhancement
As a developer of a client library that makes use of Invoke-WebRequest, I would like to be able to easily extend the default User-Agent header that is sent. The Microsoft.PowerShell.Commands.PSUserAgent class provides public static strings for various common user agents, but doesn't expose its own.
After some searching I was able to find a mention of a way to access the private class member, but I'm not sure I would have been able to work this out on my own:
This would be potentially more understandable and discoverable if it were exposed in the same way as the other user agents, e.g:
The end goal was to be able to do something like this:
Proposed technical implementation details (optional)
I believe the relevant file is here. I'm not a c# developer but guessing this would go something like this:
The text was updated successfully, but these errors were encountered: