powershell 常用命令之取磁盘分区信息
//查看mac 地址 PS C:\Users\yyy> get-wmiobject -class Win32_NetworkAdapterConfiguration -namespace "root\cimv2" | select ServiceName,ipadress,MacAddress ServiceName ipadress MacAddress ----------- -------- ---------- kdnic e1dexpress rtux64w10 tunnel tunnel RasSstp RasAgileVpn Rasl2tp PptpMiniport RasPppoe NdisWan B6:EB:20:52:41:53 NdisWan BA:AC:20:52:41:53 NdisWan BA:C3:20:52:41:53 tunnel kmloop tunnel Netwtw04 EA:6A:56:C6:51:6B vwifimp 00:28:F8:B2:A9:4F RFCOMM BthPan 00:28:F8:B2:A9:52 VMnetAdapter 00:50:56:C0:00:01 VMnetAdapter 00:50:56:C0:00:08 tunnel
PS C:\Users\yyy> Get-CimInstance Win32_Process | select ProcessId,name,CommandLine ProcessId name CommandLine --------- ---- ----------- 0 System Idle Process 4 System 392 smss.exe 9764 TIM.exe "C:\Program Files (x86)\Tencent\TIM\Bin\TIM.exe" /hosthwnd=200188 /hostname=QQ_IPC_{E19D6CD2-94DA-4777-8F39-A86E3376947C} /memoryid=0 "C:\Program Files (x86)\Tencent\TIM\Bin\TIM.exe" 5160 TXPlatform.exe "C:\Program Files (x86)\Tencent\TIM\Bin\TXPlatform.exe" -Embedding 3432 powershell.exe "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" 7084 conhost.exe \??\C:\Windows\system32\conhost.exe 0x4
PS C:\Users\yyy> Get-WmiObject -Class Win32_LogicalDisk | select * PS C:\Users\yyy> Get-WmiObject -Class Win32_LogicalDisk | select deviceid,size,freespace deviceid size freespace -------- ---- --------- C: 209121701888 17412263936 D: 290391584768 37319020544
PS C:\Users\yyy> Get-WMIObject Win32_ComputerSystem| select * PS C:\Users\yyy> Get-WMIObject Win32_ComputerSystem| select name,domain name domain ---- ------ DESKTOP-G2Q1KTA WORKGROUP
//取系统信息 版本号
PS C:\Users\yyy> Get-CimInstance Win32_OperatingSystem | select caption,version,codeset caption version codeset ------- ------- ------- Microsoft Windows 10 专业版 10.0.14393 936
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步