I am using Get-item env:\username and I would only like to grab the value so I can set it to $strname
PS C:\Users\testuser> Get-Item env:\username
Name Value
USERNAME testuser
Thank you for assistance.
I am using Get-item env:\username and I would only like to grab the value so I can set it to $strname
PS C:\Users\testuser> Get-Item env:\username
Name Value
USERNAME testuser
Thank you for assistance.
I was able to figure it out.
Thank you
For environment variables, there’s a shortcut syntax:
$env:username
I’m not sure where “Remotely” comes into this question, though.
$strName = (Get-Item -Path Env:\USERNAME).value