Skip to content

Add back Get-Counter cmdlet for Windows - #10933

Merged
Travis Plunk (TravisEz13) merged 8 commits into
PowerShell:masterfrom
SteveL-MSFT:perfcounters
Nov 6, 2019
Merged

Travis Plunk (TravisEz13) merged 8 commits into
PowerShell:masterfrom
SteveL-MSFT:perfcounters

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 29, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Reviewed the APIs being used. Get-Counter can work with just public APIs published in pdh.h. Import-Counter and Export-Counter rely on undocumented APIs so those are removed. The PDH apis are really old so I don't believe there's any chance to get those APIs or the binary log format documented so removed that code. Get-Counter -ListSet has Description property as empty because it isn't supported by PDH apis.

PR Checklist

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Sean Wheeler (@sdwheeler) new fwlink for Get-Counter?

@sdwheeler

Sean Wheeler (sdwheeler) commented Oct 29, 2019 •

Copy link
Copy Markdown
Contributor

Steve Lee (@SteveL-MSFT) https://go.microsoft.com/fwlink/?linkid=2109647

The Get-Counter cmdlet gets performance counter data directly from the performance monitoring instrumentation in the Windows family of operating systems. Get-Counter gets performance data from a local computer or remote computers. You can use the Get-Counter parameters to specify one or more computers, list the performance counter sets and the instances they contain, set the sample intervals, and specify the maximum number of samples. Without parameters, Get-Counter gets performance counter data for a set of system counters. Many counter sets are protected by access control lists (ACL). To see all counter sets, open PowerShell with the Run as administrator option.

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found https://github.com/microsoft/Tx. It seems work with blg.

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 30, 2019
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) nice find, seems that Tx is using a different set of APIs to read the log, not sure if there is a different public api to write the binary log. I suggest we defer this for now.

@iSazonov

Copy link
Copy Markdown
Collaborator

I suggest we defer this for now.

Maybe open a tracking issue if you plan to investigate this?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) created #10946

@TravisEz13

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Can you run a coordinated package build and send me a Direct Message with the build information? Let's verify this doesn't cause any new compliance issues.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 5, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 5, 2019
@TravisEz13
Travis Plunk (TravisEz13) merged commit 7ddfb82 into PowerShell:master Nov 6, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the perfcounters branch November 6, 2019 16:16
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants