How to find out all cmdlet that contains -filer parameters

Welcome Forums General PowerShell Q&A How to find out all cmdlet that contains -filer parameters

Viewing 3 reply threads
  • Author
    Posts
    • #230188
      Participant
      Topics: 19
      Replies: 11
      Points: 193
      Rank: Participant

      Hello everyone,

      I have two question about ps:

      1. How to find out all cmdlet that contains -filer parameters , I tried Get-Command | where SYNTAX -Match “-Filter” ,but not work.

      2. In Linux, if I want to know which daemon listen on which ports , I will use ss -tln as bellow.

      [xxx@myserver ~]$ ss -tlp
      State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
      LISTEN 0 128 0.0.0.0:ms-wbt-server 0.0.0.0:*
      LISTEN 0 4096 0.0.0.0:websm 0.0.0.0:*
      LISTEN 0 128 0.0.0.0:ircu-2 0.0.0.0:*
      LISTEN 0 4096 127.0.0.1:h2250-annex-g 0.0.0.0:*
      LISTEN 0 128 0.0.0.0:ssh

      This is a very convenient way at work, but how to do that in ps , Get-NetTCPConnection , it lists PID ,but not list process name, how to list both?

      Thanks in advance.

      BR

      Alex

      • This topic was modified 1 week, 3 days ago by tlsalex27.
    • #230290
      Participant
      Topics: 0
      Replies: 14
      Points: 175
      Helping Hand
      Rank: Participant

      Hello Alex,

      # 1
      Get-Command | Where { $_.parametersets -like "*Filter*"}
      
      #2
      Get-Process -Id (Get-NetTCPConnection -LocalPort <portNumber>).OwningProcess
      
      

      Reference: https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows

       

      Hope that helps.

      • This reply was modified 1 week, 3 days ago by AndySvints.
    • #230332
      Participant
      Topics: 5
      Replies: 322
      Points: 445
      Helping Hand
      Rank: Contributor
      Get-Command -ParameterName filter
    • #230347
      js
      Participant
      Topics: 29
      Replies: 813
      Points: 2,450
      Helping Hand
      Rank: Community Hero

      There’s no syntax property. This seems to work:

      get-command | where definition -match '-filter'
Viewing 3 reply threads
  • You must be logged in to reply to this topic.