Internal/Test-NanoServer.ps1

1
2
3
4
5
6
7
8
9
10
11
12

function Test-NanoServer {
    try {
        # Check if this is nano server. [System.Runtime.Loader.AssemblyLoadContext] is only available on NanoServer
        [System.Runtime.Loader.AssemblyLoadContext]
        return $true
    }
    catch {
        return $false
    }
}