1

I have a very simple script where I upload files to a folder in a SharePoint site. But I would like to upload them to a "subfolder". Can anyone help me modify my script?

It looks like this at the moment:

$spWeb = Get-SPWeb "mysite"
$spList = $spWeb.Lists["Reports"]
$file = [io.file]::ReadAllBytes('D:\temp\test.rdl')
$spList.RootFolder.Files.Add("test.rdl",$file)

So under folder "Reports" I have plenty of Subfolders where I would like to upload my files insted of root folder "Reports".

Thanks in advance

1 Answer 1

1
$folder = $web.GetFolder($folderUrl)
$folder.Files.Add("test.rdl", $file)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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