Split text by columns in PowerShell

后端 未结 12 2121
猫巷女王i
猫巷女王i 2020-11-28 15:37

I\'m a PowerShell novice (Bash is my thing normally) who\'s currently trying to obtain qwinsta output to show who is logged in as an \'rdpwd\' (rdesktop) user so that I can

12条回答
  •  感动是毒
    2020-11-28 16:08

    Do it exactly the same way you should if your shell was bash:

    $ awk '$NF=="rdpwd"{print $2}' file 
    user.name1
    user.name2
    user.name3
    

    Caveat: I've no idea what "powershell" is but you tagged the question with awk so I assume "powershell" is some kind of shell and calling awk from it is an option.

提交回复
热议问题