Thomas Bratt Thomas Bratt - 1 year ago 116
PowerShell Question

How to get current username in Windows Powershell?

How to get the current username in Windows Powershell?

Answer Source

Found it:

[Environment]::UserName

There is also:

[Environment]::UserDomainName
[Environment]::MachineName