我目前能够传输文件..但不知何故,内容被遗漏了。我认为该对象没有正确返回,但无法弄清楚。 有什么帮助吗?
context.Response.OnSendingHeaders
错误:Receive-JFSItem:没有这样的文件;没有这样的文件。
错误:Receive-JFSItem<<<< $ fileSuffix -destination $ folder2
答案 0 :(得分:1)
您错误地使用了TrimStart
。 TrimStart
接受符号集以从参数中修剪,并且您希望将文件夹名称从其开头修剪为精确字符串。您应该使用$folder1
中的空字符串替换$_.fullname
。
If (!(Test-Path($_.FullName.Replace($folder1, $folder2))))
{
$fileSuffix = $_.FullName.Replace($folder1,"")
Write-Host "$fileSuffix is only in folder1"
Receive-JFSItem $fileSuffix -destination $folder2
}