Rename files in bulk:
> Get-ChildItem -Filter “*current*” -Recurse | Rename-Item -NewName {$_.name -replace ‘current’,’old’ }
Listen to new lines in a log fil containing a specific regex:
> Get-Content .\application_2017-05-30.log -Wait -Tail 0 | Select-String '.+(UserRepository).+'
Run first line only of a script:
> Get-Content <script> -First 1 | Invoke-Expression
Last updated 4 years ago