I have a Wiki Page in SharePoint . which i want to be populated by Build results from another server using an Automatic script ,
but after digging through forums and google im unable to find a good example of how to do it, I frankly don
t mind what language its preformed with , but my personal preference is ether Python or Powershell, i assume its done through some API requests , but for crying out loud i was not able to find any examples .
Thank you in advance .
PowerShell:
$web = Get-SPWeb 'https://url-of-sharepoint-site'
$sitePages = $web.Lists['Site Pages']
$sitePagesUrl = $sitePages.RootFolder.ServerRelativeUrl
$wikiPageUrl = "$sitePagesUrl/name-of-wiki-page.aspx"
$wikiPage = $web.GetFile($wikiPageUrl)
if (!$wikiPage.Exists)
{
$wikiPage = [Microsoft.SharePoint.Utilities.SPUtility]::CreateNewWikiPage($sitePages, $wikiPageUrl)
}
$wikiContent = "<p>Your Wiki page content goes here</p>"
$wikiItem = $wikiPage.Item
$wikiItem[[Microsoft.SharePoint.SPBuiltInFieldId]::WikiField] = $wikiContent
$wikiItem.Update(); # or SystemUpdate() if you wish