Last active
January 29, 2019 16:18
-
-
Save easierbycode/1cc51b975b403e215137103e6b2a5c50 to your computer and use it in GitHub Desktop.
PowerShell notes - grep, get process by port, $PATH, etc
This file contains hidden or 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 $PATH | |
| [Environment]::GetEnvironmentVariable('path', 'machine') | |
| # get process by port | |
| Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess | |
| # grep like functionality | |
| $vueWarns = $cmdOutput | Out-String -Stream | Select-String "^(?!.*rootGetters).*(Vue warn).*$" | |
| if ($vueWarns.Length -gt 0) { | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment