Skip to content

User Agent Statically Reports "Windows NT" as the platform. #4913

Closed

Description

Steps to reproduce

$bingdings = [System.Reflection.BindingFlags]::NonPublic -bxor [System.Reflection.BindingFlags]::Static
[Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('Platform',$bingdings).GetValue($null,$null)

Expected behavior

This should change based on the platform

Examples

OS Platform
Windows Windows NT
macOS Macintosh
Linux Linux

Actual behavior

Windows NT

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.7
OS                             Linux 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. added
    Issue-Bug
    Up-for-Grabs
    on Sep 25, 2017
  2. added this to the milestone on Sep 25, 2017
  3. SteveL-MSFT commented on Sep 25, 2017

    @SteveL-MSFT
    Member

    Expected platform seems right based on behavior of Internet Explorer and Safari

  4. iSazonov commented on Sep 26, 2017

    @iSazonov
    Collaborator

    I see the UserAgent class contains public properties to emulate different User-Agents.
    Based on FireFox it seems the properties return broken User-Agent strings. We don't use the properties. Why we expose its? If an user want emulate a native User-Agent string he can copy-paste real string.

  5. markekraus commented on Sep 26, 2017

    @markekraus
    ContributorAuthor

    Maybe removing the public members could be a separate issue. It's definitely a breaking change as people use it now.

    My real concern is the Internal UserAgent member which the public will come to recognize as PowerShell's User-Agent signature for the Web Cmdlets (and for better or worse shape their HTTP responses to it). That should definitely have the correct Platform portion.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-FixedUp-for-GrabsWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions