I have a backup script that is supposed to target a specific local folder and backup the folder to a remote shared folder on another server.
When I run my script, Powershell prompts me with the following error:
One of the file paths specified for backup is that of a remote shared folder. Backup of a remote shared folder is not allowed.
The following code is the cause for the underlying issue:
$current_day = ("\\backupsrv01\Homes\" + $day)
The variable $day is just the current day.
$date = Get-Date
$day = $date.DayOfWeek
How can I successfully target a remote share using Powershell?