0

I have a current script which upload different .rdl files to my sharepoint site and in to different folder. E.g below:

It looks like this:

$spWeb = Get-SPWeb "mysite" 

$spList = $spWeb.Lists["Reports"]

$file = [io.file]::ReadAllBytes('D:\temp\test.rdl')

$spList.RootFolder.SubFolders["Test"].Files.Add("test.rdl",$file)

Now I would like to add data as well. E.g Datasource, Type, Credentials etc.

Anyone who can help me out?

Thank you.

0

get the item by file and update the metadata of the file

$tFile = $folder.Files.Add("test.rdl",$file)
$tItem=  $tFile.Item
$tItem["Title"]="title1"
$tItem.Update()
$tFile.Update()
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.