unregister_odpm_perfmon_counters.ps1 425 B

123456789101112
  1. $categoryName = "ODP.NET, Managed Driver"
  2. try{
  3. $categoryExists_unreg = [System.Diagnostics.PerformanceCounterCategory]::Exists($categoryName)
  4. if($categoryExists_unreg)
  5. {
  6. [System.Diagnostics.PerformanceCounterCategory]::Delete($categoryName) | out-null
  7. }
  8. write-host("$categoryName Performance Counter was un-registered successfullly.")
  9. }
  10. catch{
  11. write-host("ERROR: $categoryName Performance Counter un-registration failed.")
  12. }