Skip to content

Command Line

Vlad Volkov edited this page Mar 5, 2021 · 4 revisions

Windows Powershell Cheatsheet'

Start new session

  • [Win]+[R] - powershell or
  • [Win]+[R] - pwsh if you have PowerShell 7 installed

List env variables

Get-ChildItem Env:

Get env variable

Get-Variable -ValueOnly <ENV-VAR-NAME>

You can use gv alias insteadof Get-Variable

Set env variable

Set-Item Env:<ENV-VAR-NAME> <ENV-VAR-VALUE>

Check open process & port

Get-Process -Id (Get-NetTCPConnection -LocalPort <PORT>).OwningProcess