Нужно копировать бэкапы базы данных с виндовой машины. Машина не в домене, и копировать нужно на шару. Я попробовал составить скрипт такой:
$password = Get-Content C:\password.txt | ConvertTo-SecureString
$login = "workgroup\root"
$cred = New-Object System.Management.Automation.PSCredential($login,$password)
New-PSDrive -Name source -PSProvider FileSystem -Root \\BIOSRV\DB-backups -Credential $cred_bio | Out-Null
New-PSDrive -Name target -PSProvider FileSystem -Root \\file-srv\backup01 | Out-Null
Copy-Item -Path source:\'*'.sql -Confirm -Credential $cred_bio -Destination target: -Force
Remove-PSDrive source
Remove-PSDrive target
И выдает он мне вот такую ошибку: The FileSystem provider supports credentials only on the New-PSDrive cmdlet. Perform the operation again without specifying credentials
я на powershell не писал никогда
robocopy
.