powershell - Powershell 2.0的get-CimInstance

标签 powershell powershell-2.0

Powershell 2.0的Get-CimInstance Win32_OperatingSystem等效于什么?或等价于获取大量数据,以了解计算机是否正在运行Windows 7或8。现在,我将get-ciminstance用作该版本。 6.2是Windows 8,而6.1是Windows 7。

最佳答案

使用 Get-WmiObject 。如果您尝试获取操作系统版本号:

(Get-WmiObject Win32_OperatingSystem).Version

关于powershell - Powershell 2.0的get-CimInstance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17893130/

相关文章:

azure - 是否可以通过PowerShell命令列出extensionAttribute1-extensionAttribute15?

multithreading - 如何使用多线程脚本

powershell 循环以连续检查服务器是否已启动

powershell - 在Powershell中使用不同的输入多次调用同一函数的最佳方法是什么

powershell - 比写主机更好的打印对象的方法

azure - 使用 powershell 重命名 AD 用户时出错

powershell - 如何在 Powershell 2.0 中获取驱动器号列表

powershell - PowerShell 中的函数范围变量(使用高级方法)?

powershell - 是否可以在另一个脚本中调用 powershell 脚本作为变量?

parsing - 仅捕获 `PID` 中的 `netstat` 字段