I am currently able to transfer the file .. but somehow the content is being left out. I think that object is not being returned properly but cannot figure it out.
$folder1 = "<external server>"
$folder2 = "<local path>"
# Get all files under $folder1, filter out directories
$firstFolder = Get-JFSChildItem $folder1 | Where-Object { -not $_.PsIsContainer }
$firstFolder | ForEach-Object {
# Check if the file, from $folder1, exists with the same path under $folder2
If (!(Test-Path($_.FullName.Replace($folder1, $folder2))))
{
$fileSuffix = $_.FullName.TrimStart($folder1)
Write-Host "$fileSuffix is only in folder1"
Receive-JFSItem $fileSuffix -destination $folder2
}
}
Error: Receive-JFSItem : No such file; No such file.
Error: Receive-JFSItem <<<< $fileSuffix -destination $folder2