查询PowerShell当前版本$psversiontable.BuildVersion.Major
查询Windows当前版本:[System.Environment]::OSVersion.Version.Major([string]::concat((cmd /c "ver"))).split(" ")[3].split(".")[0]
查看系统和PowerShell版本
原文:http://www.cnblogs.com/dreamer-fish/p/4056957.html