Instantly share code, notes, and snippets.

Embed
What would you like to do?
function Get-Page($fileName) {
$pageFile = "/" + $librarySitePages + "/" + $fileName
$filesFolder = ".\" + $folderFiles
If(!(test-path $filesFolder)){
New-Item -ItemType Directory -Force -Path $filesFolder
}
$folderPath = $PSScriptRoot + "\" + $folderFiles
#Save file to locale
Get-PnPFile -Url $pageFile -AsFile -Path $folderPath
#Add file data to provisioning template
$filePath = $folderPath + "\" + $fileName
Add-PnPFileToProvisioningTemplate -Path $rootsiteTemplateFileName -Source $filePath -Folder $librarySitePages
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment