Skip to content

The $IsLinux variable is set to true on non-Linux platforms #24257

@rhubarb-geek-nz

Description

@rhubarb-geek-nz

Prerequisites

Steps to reproduce

I am running PowerShell as a native FreeBSD build using RID "freebsd-x64" and "freebsd-arm64".

Expected behavior

I would expect when on FreeBSD for $IsLinux to be false

I would expect $IsLinux to have the same value as [System.OperatingSystem]::IsLinux()

Actual behavior

PS> @{ IsWindows=$IsWindows;IsLinux=$IsLinux;IsMacOS=$IsMacOS }

Name                           Value
----                           -----
IsLinux                        True
IsMacOS                        False
IsWindows                      False

PS> [System.OperatingSystem]::IsLinux()
False
PS> [System.OperatingSystem]::IsFreeBSD()
True

Error details

no actual error

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
OS                             FreeBSD 13.3-RELEASE FreeBSD 13.3-RELEASE releng/13.3-n257428-80d2b634ddf0 GENERIC
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0â€}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

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