I work at a school and have a script to create sites, users and folders automatically. In the finaI steps of the script I need to copy a page from a Sharepoint to another and make it the homepage, but I can't and have been stuck...
Here's what I have so far...
$cred = Get-Credential
Connect-PnPOnline -Url https://acme.sharepoint.com/sites/sitewiththepagemodel -Credentials $cred
$tempFile = [System.IO.Path]::GetTempFileName();
Export-PnPPage -Identity "Bem-vindo-ao-site-da-Turma.aspx" -Force -Out $tempFile
Connect-PnPOnline -Url "https://acme.sharepoint.com/sites/sitebeingcreated" -Credentials $cred
Apply-PnPProvisioningTemplate -Path $tempFile
Set-PnPHomePage -RootFolderRelativeUrl Bem-vindo-ao-site-da-Turma.aspx
But the above code says
Apply-PnPProvisioningTemplate : The term 'Apply-PnPProvisioningTemplate' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
I used to had an error on Export-PNPPage, reinstall and now it's the Apply-PnPProvisioningTemplate that's not working. Does this exist in the last version? Also, is there an easier way to do this?
Thanks a lot for your kind help. I'm not very good at Powershell, so please be gentle! ;)