PowerShell 脚本或批处理脚本来获取与处理器相关的信息。以下是一些脚本: PowerShell 脚本: Get-WmiObject -Class Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors 批处理脚本: wmic cpu get Name, NumberOfCores, NumberOfLogicalProcessors 这些脚本将提供有关 CPU 的信息,包括核心...
Status Name DisplayName --- --- --- Running w32time Windows Time 若要列出所有可用的属性和方法Get-Service,请通过管道将其传递给Get-Member。 PowerShell Get-Service-Namew32time |Get-Member 结果显示第一行包含一条重要信息。TypeName标识返回的对象类型,在本示例中为System.ServiceProcess.ServiceController...
$Server=$env:computername #server's CPU Mem Hardinfor $IpAdd= (Get-WmiObject-classwin32_NetworkAdapterConfiguration-Filter'ipenabled = "true"').ipaddress[0] $SystemVersion=Get-WmiObject-ClassWin32_OperatingSystem |Select-Object-ExpandPropertyCaption $cpu=gwmi-computername$Serverwin32_Processor $men...
param($ComputerName =$env:COMPUTERNAME) $header = 'Hostname','OSName','OSVersion','OSManufacturer','OSConfiguration','OS Build Type','RegisteredOwner','RegisteredOrganization','Product ID','Original Install Date','System Boot Time','System Manufacturer','System Model','System Type','Process...
get-wmiobject -class __NAMESPACE -namespace "root" -list 4、常用类 参考网址:docs.microsoft.com/zh-c 列出所有WMI类 Get-CimClass -ClassName "Win32*" > D:\1.txt Get-CimClass -ClassName "*" > D:\2.txt 4.1 硬件 Win32_Processor, // CPU 处理器 Win32_PhysicalMemory, // 物理内存条 ...
Get-CimInstance-ClassNameWin32_Processor 输出 DeviceID Name Caption MaxClockSpeed SocketDesignatio n --- --- --- --- --- CPU0 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz Intel64 Family 6 Model 158 Stepping 10 2904 CPU 0 CPU1 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz...
如以下示例所示,可以使用Get-CommandParameterName参数来标识包含ComputerName参数的 cmdlet。 PowerShell Get-Command-ParameterNameComputerName Output CommandType Name Version Source --- --- --- --- Cmdlet Add-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Clear-EventLog 3.1.0.0 Microsoft.PowerShell...
functionGet-Resources{param($computername=$env:computername)$Info=""|Select ComputerName,Memery,DiskSize,FreeDSize$info.ComputerName=$computername# Processor utilization# $cpu = gwmi win32_perfformatteddata_perfos_processor -ComputerName $computername| ? {$_.name -eq "_total"} | select -ExpandPro...
Get-Process | Format-List * 输出结果 Name : AcroRd32 Id : 8052 PriorityClass : Normal FileVersion : 11.0.23.22 HandleCount : 616 WorkingSet : 17453056 PagedMemorySize : 114597888 PrivateMemorySize : 114597888 VirtualMemorySize : 374849536 TotalProcessorTime : 00:00:39.6562500 SI : 1 Handles :...
Write-Output---InputObject$env:PROCESSOR_ARCHITECTURE Output -InputObject AMD64 此行为仅适用于 PowerShell 命令。 如果在调用外部命令时使用该--令牌,字符串--将作为参数传递给该命令。 PowerShell TestExe-echoargs-a-b---c 输出显示--作为参数传递给TestExe的 。