get-wmiobject sql join in powershell - 尝试查找远程系统的物理内存与虚拟内存
get-wmiobject -query "Select TotalPhysicalMemory from Win32_LogicalMemoryConfiguration" -computer COMPUTERNAME >>output.csv
get-wmiobject -query "Select TotalPageFileSpace from Win32_LogicalMemoryConfiguration" -computer COMPUTERNAME >>output.csv
我正在尝试使用以下命令完成此脚本这样的输出:
Computer Physical Memory Virtual Memory
server1 4096mb 8000mb
server2 2048mb 4000mb
get-wmiobject -query "Select TotalPhysicalMemory from Win32_LogicalMemoryConfiguration" -computer COMPUTERNAME >>output.csv
get-wmiobject -query "Select TotalPageFileSpace from Win32_LogicalMemoryConfiguration" -computer COMPUTERNAME >>output.csv
I am trying to complete this script with an output as such:
Computer Physical Memory Virtual Memory
server1 4096mb 8000mb
server2 2048mb 4000mb
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有什么事情阻止你做这样的事情吗?
(未经测试,因为 Get-WmiOject 不知道此处的 Win32_LogicalMemoryConfiguration 类。但可能有效。)
Is anything keeping you from doing something like this?
(Untested, since Get-WmiOject doesn't know the class Win32_LogicalMemoryConfiguration here. But might work.)
Win32_LogicalMemoryConfiguration 似乎已过时。我认为这个函数会得到你想要的信息:
你可以通过管道将计算机列表输入Get-MemoryInfo。如果您想要 csv 文件,则将输出通过管道传输到 Export-Csv 中。
Win32_LogicalMemoryConfiguration appears to be obsolete. I think this function will get the information you want:
You can pipe the list of computers into Get-MemoryInfo. Then pipe the output into Export-Csv if you want a csv file.