Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Last active January 29, 2019 16:18
Show Gist options
  • Save easierbycode/1cc51b975b403e215137103e6b2a5c50 to your computer and use it in GitHub Desktop.
Save easierbycode/1cc51b975b403e215137103e6b2a5c50 to your computer and use it in GitHub Desktop.
PowerShell notes - grep, get process by port, $PATH, etc
# 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