2014-06-24 30 views

回答

1

有沒有任何內置的cmdlet來做到這一點。但是,由於您可以使用整個.NET Framework,因此可以使用PerformanceCounterCategory.Create來創建計數器類別。要在遠程機器上創建它們,您必須啓用PowerShell遠程處理。一個例子,它創建NumberOfItems32類型的單個實例類別:

Invoke-Command -ComputerName remotemachine -ScriptBlock { [System.Diagnostics.PerformanceCounterCategory]::Create("category name", "category help", "SingleInstance", "counter name", "counter help") } 

有跡象表明,採取額外的數據(例如作爲反式),並讓你創建該種類的多個計數器其他重載。

相關問題