Background: I have an ubuntu machine that hosts a couple applications that I am in charge of and I want to automate the backup of the database that powers these applications. I noticed that PowerShell is now cross platform, so I figured a simple script to run mysql dump and then move the dump file to a different server would fill my needs exactly.
Unfortunately, I seem to be stuck at mounting a temporary PS drive.
I did a ping test so the two servers can communicate with each other, however the log on credentials for the ubuntu machine is different than what the windows host would expect. in the below setup I double checked username and password, they are correct.
$user = "domain\username"
$pass = ConvertTo-SecureString -String "my password" -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user, $pass
New-PSDrive -Name "SQL Backups" -PSProvider "FileSystem" -Root "\\server\folder" -Credential $cred
error response:New-PSDrive: The specified drive root "\\server\folder" either does not exist, or it is not a folder
I know the folder/path exists as I can pull it up on a windows machine through file explorer.
Should/is it possible to move a file from an Ubuntu host to a Windows host with PowerShell core installed on the former? Or am I going down a rabbit hole?
PSVersion: 7.2.1
PSEdition: Core