From LedHed's Wiki
Jump to: navigation, search

Overview

Sometimes Linux Admins have to do stuff on Windows, and you curse Microsoft because they don't have Grep and Tail. Well PowerShell gives you similar functionality (albeit more complicated/less intuitive).


Command

Get-Content -Path c:\Windows\debug\netlogon.log -Tail 1 -Wait | Select-String "SomeUser" > c:\temp\someuser_netlogon.txt

Translation:

tail -f /windows/debug/netlogon.log | grep SomeUser > /tmp/SomeUser_netlogon.txt


Enjoy!