使用している Windows のバージョンを確認するにはどうすればいいですか?
PowerShell 2.0 を使用していて、次のことを試しました:
PS C:\> ver
The term 'ver' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify tha
t the path is correct and try again.
At line:1 char:4
+ ver <<<<
+ CategoryInfo : ObjectNotFound: (ver:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
どうすればいいですか?
ベストアンサー1
.NETライブラリにアクセスできるので、OSVersion
の財産System.Environment
この情報を取得するには、クラスを使用します。バージョン番号については、Version
プロパティがあります。
例えば、
PS C:\> [System.Environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
6 1 7601 65536
Windowsバージョンの詳細については、ここ。