I'm using the latest preview of Windows Server 2016 nano.
Using a remote powershell session, I connect to the remote system via
Enter-PSSession, and then I tried to use the most common techniques to check Windows versions, because the full .Net framework is not available. Also, Get-WmiObject cmdlet is not available.
The only way I can see SOME information is with this non-powershell-command DISM:
Dism /Online /Get-Feature
That gives me this output plus a list of installed features:
Deployment Image Servicing and Management tool Version: 10.0.10514.0 Image Version: 10.0.10514.0 Features listing for package : Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~10.0.10514.0
From the 10514 value, which is higher than my Windows 10 desktop, I can get some idea of the Kernel Build, and it is interesting that Windows 10 desktop has the same "Microsoft-Windows-Foundation-Package", but a lower kernel build number.
Has anyone found a cmdlet or some powershell function or alias that could be written, that will either detect for me the fact that my powershell script is running on a nano-server, in some way which is unlikely to break, or any command which will actually print out "Windows Server 2016 Nano Server"?
Update: This is closer to what I want, but is a bit of a hack:
Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion'
Update 2: Get-WmiObject is not present, and while the following works, it only reports kernel version:
Above will report build 10514, whereas Windows 10 client operating systems RTM reports 10240 at the moment, but the above is really a "kernel build" not an operating system product/edition/service-pack-level.