c++ - 与 powershell get-physicaldisk 命令等效的 Windows API

标签 c++ windows powershell hard-drive

在 Windows 服务器中配置存储池(物理磁盘 1 和物理磁盘 2)并在存储池外创建虚拟磁盘。创建虚拟磁盘后,可以在VDS服务中看到Physical disk 3(Virtual disk)。

Power shell 命令:get-physicaldisk 提供所有物理磁盘详细信息,包括物理磁盘 1 和物理磁盘 2。

是否存在等效于 get-physicaldisk 命令的 Windows API? 如果是,请向我推荐 API。

最佳答案

也许你可以使用Microsoft WMI - Windows Management Instrumentation通过 MSFT_PhysicalDisk class 获取信息.

在这里https://stackoverflow.com/a/33359142/15485您可以找到一个 C 示例作为起点。

关于c++ - 与 powershell get-physicaldisk 命令等效的 Windows API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51761005/

相关文章:

powershell - 使用 Powershell DSC 包资源安装 exe 会获得返回代码 1619

powershell - 通过 PSSession 下载 PS5 文件

c++ - reinterpret_cast 和交叉类型转换

c++ - xcode 不显示输出

c++ - 为什么必须使用引用来返回/传递 std::ostream?

windows - 共享内存段中某个位置的原子比较和交换

c++ - 私有(private)成员的继承

python - 使用cmd将文件从windows传输到linux服务器

linux - 如何通过 SSHLibrary 编辑远程文件?

asp.net - 如何使用 PowerShell 了解托管在 IIS 中的特定网站的事件 session 计数