Last active
April 10, 2019 06:35
-
-
Save morriekken/2d673538dcfbabc049f47560807c38de to your computer and use it in GitHub Desktop.
PowerShell one line snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get first 10 lines | |
Get-Content ./log.log -First 10 | |
# Get last 10 lines | |
Get-Content ./log.log -Tail 10 | |
# Get last 10 lines and wait for new to arrive | |
Get-Content ./log.log -Wait -Tail 10 | |
# Search for string in files in current directory and subdirectories | |
Get-ChildItem -recurse | Select-String -pattern "TEXTTOFIND" | group path | select name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment