LoginSignup
0
0

PowerShellでWindowsの様々な情報を確認する

Posted at

What's?

PowerShellで、Windows上の様々な情報を確認するコマンドをまとめておきたいなということで。

Windowsのバージョンを確認する

> [System.Environment]::OSVersion

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.19045.0 Microsoft Windows NT 10.0.19045.0


CPUの情報を確認する

> Get-WmiObject Win32_Processor


Caption           : Intel64 Family 6 Model 142 Stepping 12
DeviceID          : CPU0
Manufacturer      : GenuineIntel
MaxClockSpeed     : 2304
Name              : Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
SocketDesignation : U3E1

搭載メモリを確認する

> Get-WmiObject Win32_PhysicalMemory | Select-Object Capacity

   Capacity
   --------
17179869184

複数表示される場合は、その和になるようです。

使用状況はsysteminfoで見た方がよいかもしれません。

> systeminfo | Select-String メモリ

物理メモリの合計:       16,147 MB
利用できる物理メモリ:   xx,xxx MB
仮想メモリ: 最大サイズ: xx,xxx MB
仮想メモリ: 利用可能:   xx,xxx MB
仮想メモリ: 使用中:     xx,xxx MB

PowerShellのバージョンを確認する

> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  4291

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4291
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4291
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

about_Automatic_Variables / $PSVersionTable

.NETのバージョンを確認する

> [System.Environment]::Version

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      30319  42000

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0