Привет! Я использую этот скрипт для загрузки файла в библиотеку на точке обмена, но я получаю эту ошибку, любая помощь приветствуется.
$Output = "c:\temp\users_PermisionReport.txt"
$WebURL = "http://url"
$ListName = "Documents"
//Create something to upload, in this case a list of all sites
Get-SPSite | Out-File -FilePath "url" $Output
//Upload the results to SharePoint
$File = Get-Item $Output
$Stream = $File.OpenRead()
$Web = Get-SPWeb $WebURL
$List = $Web.Lists["$ListName"]
$FileCollection = $List.RootFolder.Files
$FileCollection.Add($File.Name,$Stream,$true)
$Stream.Close()
$File.Delete()
это ошибка:
Out-File : Cannot validate argument on parameter 'Encoding'. The argument
"c:\temp\users_PermisionReport.txt" does not
belong to the set
"unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem"
specified by the
ValidateSet attribute. Supply an argument that is in the set and then try
the command again.
At C:\Users\balaji.chode\Desktop\UpDoc.ps1:6 char:59
+ Get-SPSite | Out-File -FilePath "url" $Output
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Out-File],
ParameterBindingValidationException
+ FullyQualifiedErrorId :
ParameterArgumentValidationError, Microsoft.PowerShell.Commands.OutFileCommand
Я использую оболочку администратора сервера share point. спасибо