更新时间:2023-02-16 21:23:13
这应该可以解决您得到的错误:
This should fix the error you're getting:
$content = get-content "C:\linktodocumenttemplate.txt"
$utf = new-object System.Text.UTF8Encoding
$newFile = $docLibrary.RootFolder.Files.Add($newDestinationFolderPath, $utf.GetBytes($content.ToString()), $true)