Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

How can I get the current logged user name when I copy (powershell)

$
0
0

Hello!

I have this:

$target='\\server\%username%'

$paths|%{Copy-Item $_ $target}

How can I get the current logged user name in the target field when I want to copy?

I know this environment variable: $env:username , but how could I paste it to the copy command?

Thank you!


Viewing all articles
Browse latest Browse all 15370

Trending Articles