标题: [转载代码] PowerShell获取系统版本、位数、SP等操作系统信息 [打印本页]
作者: PS2.0 时间: 2017-8-18 09:58 标题: PowerShell获取系统版本、位数、SP等操作系统信息
PS C:\> (Get-WmiObject -class Win32_OperatingSystem).Caption
Microsoft Windows 7 Enterprise
- # ServicePack 版本
- Get-CimInstance -ClassName Win32_OperatingSystem | select ServicePackMajorVersion, ServicePackMinorVersion
- # 操作系统的安装日期
- Get-CimInstance -ClassName Win32_OperatingSystem | select Installdate
- # Windows 版本
- Get-CimInstance -ClassName Win32_OperatingSystem | select Caption, Version
- # Windows 目录
- Get-CimInstance -ClassName Win32_OperatingSystem | select WindowsDirectory
复制代码
http://www.pstips.net/get-os-info-by-win32_operatingsystem.html
作者: PS2.0 时间: 2017-8-18 10:10
系统位数
- if ([Environment]::Is64BitOperatingSystem) {
- '64-bit'
- }
- else {
- '32-bit'
- }
复制代码
- (Get-WmiObject Win32_OperatingSystem).OSArchitecture
复制代码
http://www.pstips.net/detecting-64-bit-operating-system.html
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |