How can I copy from local to a remote location with credentials in PowerShell?
问题 I am a fresh beginner to PowerShell. I have username and password to reach a shared folder in a remote location. I need to copy the file foo.txt from the current location to \\Bar.foo.myCOmpany.com\logs within a PS1 script that is written for Powershell v3.0 . How can I achieve this? 回答1: Copy-Item doesn't support the -credential parameter, This does parameter appear but it is not supported in any Windows PowerShell core cmdlets or providers" You can try the below function to map a network