使用PowerShell设置性能计数器值

使用PowerShell设置性能计数器值,powershell,performancecounter,Powershell,Performancecounter,有没有办法使用PowerShell设置性能计数器的值 $counter = (New-Object -TypeName System.Diagnostics.PerformanceCounter -ArgumentList ("CategoryName", "CounterName", "InstanceName", $false)) $counter.RawValue = 0 是的 不错,不过您可以简化第一条语句:不需要括号和引号:$counter=New Object System

有没有办法使用PowerShell设置性能计数器的值

$counter = (New-Object -TypeName System.Diagnostics.PerformanceCounter -ArgumentList ("CategoryName", "CounterName", "InstanceName", $false))    
$counter.RawValue = 0
是的


不错,不过您可以简化第一条语句:不需要括号和引号:
$counter=New Object System.Diagnostics.PerformanceCounter CategoryName、CounterName、InstanceName、$false
Nice,尽管可以简化第一条语句:不需要括号和引号:
$counter=New Object System.Diagnostics.PerformanceCounter CategoryName、CounterName、InstanceName、$false