我正在尝试运行以下脚本,我认为这很简单.我在做什么呢?
[Environment]::UserName = $username
Write-Host "The user is $username"
$from = "c:\Users\" + $username + "\favourites\*.*"
$to = "c:\test"
Write-Host "This is from dir: $from"
Write-Host "This is to dir: $to"
Copy-Item $from $to
Run Code Online (Sandbox Code Playgroud)
该剧本似乎不喜欢+ $username +......