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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s