Answer the question
In order to leave comments, you need to log in
Why PS when exporting from Sharepoint incorrectly forms the first line?
Good afternoon.
We have the following result when uploading 4 values from SP to CSV:
"RegData","podrazdelenieisp","ID","DataSozdani9"
"12/10/2018 12:00:00 AM","1;#????????","970","1/1/2018 12:00:00 AM"
"12/10/2018 12:00:00 AM","1;#Department","971","1/1/2018 12:00:00 AM"
...
Add-PSSnapin microsoft.sharepoint.powershell
$weburl = "http://#####"
$site=(Get-SPSite -Identity $weburl)
$web=$site.RootWeb
$listName = "####"
$Department = 1
$list = $web.Lists[$listName]
$items = $list.Items
ForEach ($item in $items)
{
$a = $($item["Подразделение"])
$a = $a -replace ";.*"
If ($a -eq $Department)
{
$Output =New-Object -TypeName PSObject -Property @{
ID = $item.Id
podrazdelenieisp = $item["Подразделение Исполнителя"]
RegData = $item["Дата регистрации"]
DataSozdani9 = $item["Дата создания"]
}
$Output | export-csv C:\organization.csv -Append
}
}
Remove-PSSnapIn Microsoft.SharePoint.PowerShell
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question