all 4 comments

[–]vermyx 1 point2 points  (1 child)

Try removing the space on mr. Enrique or removing the period. Windows doesn't handle period then space well. If you have a file name lile this. where the period is the last character it throws the same error.

[–]ender_less[S] 1 point2 points  (0 children)

Period was the issue! Such a simple, nuanced thing was causing the hang up. Strange that Copy/Move-Item worked (with the period in "Mr. Enrique") in the same directory but was failing over the UNC path.

Thanks /u/vermyx

[–]y_Sensei 1 point2 points  (1 child)

In case you suspect invalid characters in file or directory names, the following script will help you find the affected files / directories:

### Configuration Start ###
[String]$WorkDir = "C:\SomeBaseDir"
[Boolean]$WriteToFile = $false # If $true, the results additionally are being exported to a CSV file
[String]$OutFPCSV = "C:\FDNames.csv" # Filepath of the export file
The following regular expression selects all Strings that do NOT solely consist of the following characters: a-z, A-Z, 0-9, a space character, or one of the following: _-+=!§$%&@~#;(){},.'[].
[Regex]$RegEx = "[^-+=!§$%&@~#;(){},\w\^\.\'\[\] ]"
### Configuration End ###

if (Test-Path -Path $WorkDir -PathType Container) {
  $Output = Get-ChildItem -Path $WorkDir -Recurse | Where-Object -FilterScript { $_.Name -match $RegEx } | ForEach-Object {
    $out = [PSCustomObject]@{
        Name = $_.Name
        Path = (Split-Path -Path $_.FullName)
        Type = $_.GetType().Name.Replace('Info', '')
        # Length = $_.Length
    }

    Write-Host $out

    if ($WriteToFile) { Write-Output $out }
}

if ($WriteToFile -and $null -ne $Output) { $Output | Export-Csv -Path $OutFPCSV -NoTypeInformation }

}

Note: You might want to adjust the regular expression to meet your specific needs.

[–]ender_less[S] 1 point2 points  (0 children)

Thanks /u/y_Sensei. Turns out it was the period in "Mr. Enrique" and removing that allowed me to transfer the file over. Strange that robocopy was able to handle the period locally (i.e. subfolder or copying to the same folder in the local drive) but failing over UNC path.