Private/Test-IsCoreCLR.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Function Test-IsCoreCLR {
    <#
.SYNOPSIS
Tests for PWSH

.DESCRIPTION
Returns "$true" if run from PWSH
Returns "$false" if run from PowerShell

.EXAMPLE
Test-IsCoreCLR

Returns "$true" if run from PWSH
Returns "$false" if run from PowerShell

#>


    if ($IsCoreCLR -or $PSEdition -eq 'Core') {

        $true

    } else {

        $false

    }

}