I have a requirement to copy files from local computer to remote machines,
using the below command but its not working, please help
$Stat = $null
$Source = "C:\Temp\test\"
$Destination = "C:\temp\"
$Stat = Invoke-Command -ComputerName $server -ScriptBlock {
Copy-Item -Path $Source -Destination $Destination
} -Credential $user
Error:
Cannot bind argument to parameter 'Path' because it is null. + CategoryInfo : InvalidData: (:) [Copy-Item], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCommand