0

When i create sharepoint site with powershell:

$siteNomenclaturesURL =  "$holidaysSite/Nomenclatures"

New-SPWeb $siteNomenclaturesURL 
-Template "CMSPUBLISHING#0" 
-Name "Noms"  
-UseParentTopNav -Language 1026

$SPWebNomenclatures = Get-SPWeb -Identity $siteNomenclaturesURL 

I want to checkin welcome page for this webSite:

/Nomenclatures/Pages/default.aspx

2

$spWeb=Get-SPWeb "SiteURL"

$folder = $spWeb.RootFolder

$pageURL=$folder.WelcomePage

$page = $spWeb.GetFile($pageUrl);

if ($page.CheckedOutBy.UserLogin -eq $spWeb.CurrentUser.UserLogin)
{

$page.CheckIn("Page checked in automatically by PowerShell script")

$page.Publish("Published")

}

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.