How to get the current username in PowerShell?

There are multiple ways you can get your current username in PowerShell. The easiest way is to get from PowerShell environment variable using $env:UserName

Leave a Reply