Skip to content

Test-IsPSWindows

SYNOPSIS

Test if running PowerShell on a Windows platform.

SYNTAX

Test-IsPSWindows [<CommonParameters>]

DESCRIPTION

PowerShell Core introduced the $IsWindows variable. However, it is not available on Windows PowerShell. Use this command to perform a simple test if the computer is either running Windows or using the Desktop PSEdition.

EXAMPLES

Example 1

PS C:\> Test-IsPSWindows
True

PARAMETERS

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Boolean

NOTES

Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/

Back to top