I found it:
$env:UserName
There is also:
$env:UserDomain
$env:ComputerName
More Related Contents:
- How to run a PowerShell script without displaying a window?
- How to run a PowerShell script
- How to run a PowerShell script within a Windows batch file
- PowerShell: Setting an environment variable for a single command only
- Powershell: What’s the difference between Alias and Function?
- Is there a way to find the length of a string in Batch/PowerShell Script/VBScript? [closed]
- Batch file v PowerShell script
- Powershell: null file always generated (output of Compare-Object)
- Setting Windows PowerShell environment variables
- How do I get the result of a command in a variable in windows?
- Batch character escaping
- PowerShell difference between Write-Host and Write-Output?
- How can I uninstall an application using PowerShell?
- FORFILES date -after- (date calc in cmd file)
- Windows PowerShell: changing the command prompt
- How to stop a PowerShell script on the first error?
- Dealing with quotes in Windows batch scripts
- Difference between $? and $LastExitCode in PowerShell
- Decode PowerShell output possibly containing non-ASCII Unicode characters into a Python string
- Windows batch: sleep [duplicate]
- Which version of MSXML should I use?
- How can I run a windows batch file but hide the command window?
- “Firebase cannot be loading because running scripts is disabled on this system”, VSCode on Windows
- How to I launch a ruby script from the command line by just its name?
- Updating every profile’s registry on Windows Server 2003
- Can I send some text to the STDIN of an active process under Windows?
- How to output something in PowerShell
- Alternative to Win32_Product?
- What’s the environment variable for the path to the desktop?
- Powershell script does not run via Scheduled Tasks