打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
一键查询系统Windows基本信息的PowerShell脚本
$disk = Get-WmiObject Win32_LogicalDisk -ComputerName 'localhost' -Filter "DeviceID='C:'"
$drive = $disk.DeviceID
$free = $disk.freespace
$size = $disk.size
$used = 1-$free/$size
$percent = “{0:0.0%}” -f $used
$os = Get-WmiObject -Class Win32_OperatingSystem
$version = $os.version
$ip = (Get-NetIPAddress -interfacealias Ethernet* -AddressFamily IPv4).ipaddress
$user = $env:USERNAME
$a=(get-wmiobject -class Win32_PhysicalMemory -namespace "root\cimv2").Capacity /1gb
$b= "{0:0.0}" -f (((get-wmiobject -class Win32_PerfFormattedData_PerfOS_Memory -namespace "root\cimv2").AvailableMBytes) / 1014)
$mem=$a-$b
$cpus = (Get-WmiObject Win32_Processor).count
$msg = "
User '$user'
Hostname '$env:computername'
CPU: $cpus Core
Memory free $mem of $a GB
IPaddress '$ip'
Drive'$drive'used'$percent'
OS 'Windows$version'
"
write-host $msg
$ws = New-Object -ComObject wscript.shell
$wsr = $ws.popup("$msg","999","SystemInfo",0 + 64)
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
win10中的PowerShell命令也可以查看硬盘信息,你真的想不到
Windows管理员常用的25个PowerShell命令
硬盘数据恢复率
PowerShell应用之-Get-WmiObject -Class Win32_Service
Get The Name Of The Windows OS Installed on a Machine
RamDisk 11 on Servers
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服