get-counter in powershell 7 core is not recognized

Welcome Forums General PowerShell Q&A get-counter in powershell 7 core is not recognized

This topic contains 4 replies, has 3 voices, and was last updated by

js
 
Participant
3 weeks, 2 days ago.

  • Author
    Posts
  • #180078

    Participant
    Topics: 1
    Replies: 0
    Points: -8
    Rank: Member

    Hi all,
    i was running Get-counter command in powershell 7 core. i am getting bellow error.  i try to use Install-Module WindowsCompatibility utlity but still i am not able to use in core edition both 6 and 7 but i can run in powershell 5

    "get-counter : The term 'get-counter' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + get-counter
    + ~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (get-counter:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
    
  • #180087

    Senior Moderator
    Topics: 8
    Replies: 1085
    Points: 3,651
    Helping Hand
    Rank: Community Hero

    Using compatibility module, this is how it is.

    Invoke-WinCommand -ScriptBlock {Get-Counter}
    
  • #180132
    js

    Participant
    Topics: 25
    Replies: 692
    Points: 1,721
    Helping Hand
    Rank: Community Hero

    What is get-counter?

    • #180177

      Senior Moderator
      Topics: 8
      Replies: 1085
      Points: 3,651
      Helping Hand
      Rank: Community Hero

      cmdlet to get the performance counter.

    • #180210
      js

      Participant
      Topics: 25
      Replies: 692
      Points: 1,721
      Helping Hand
      Rank: Community Hero

      Oops, I was looking in osx.

  • #180345

    Participant
    Topics: 0
    Replies: 1
    Points: 7
    Rank: Member

    get-counter?

You must be logged in to reply to this topic.