Minimal adding pages to sharepoint

The following is the boo source to a utility that can be used to add pages to a SharePoint site.
No feature required!

=== addpage.boo ===
import Microsoft.SharePoint
import System.IO

def addPage(_site as string, _web as string, _page as string, _url as string):
    site = SPSite(_site)
    web = site.OpenWeb(_web)
    folder = web.GetFolder(“”)
    folder.Files.Add(_url, File.OpenRead(_page), true)
    
addPage(argv[0], argv[1], argv[2], argv[3])    

Leave a comment