From LedHed's Wiki
Jump to: navigation, search
(Created page with "== 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 functionali...")
 
(No difference)

Latest revision as of 00:16, 15 September 2016

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!