Sep 06 2021 09:47 AM
Hi,
We are doing site provisioning through site script where where power automate is being called for creating Azure storage queque and invoking pnp provisiong command throught Azure pnp powershell.
Invoke-PnPSiteTemplate -Path "C:\templateCustom.xml" -ResourceFolder "C:\"
Since this set up is for one language template DE then we are able to manage locale and regional setting by explicitely calling this action in SiteScript:
{
"verb": "setRegionalSettings",
"timeZone": 4,
"locale": 1031,
"sortOrder": 25,
"hourFormat": "24"
}
Now we want to extend this for multiple language and for that we have created separate pnp template for EN and RO and calling invoke pnp command by checking language ID on PnP powershell like this:
if($languageID -eq 1031)
{
Write-Output "Connected to DE site"
Invoke-PnPSiteTemplate -Path "D:\TemplateDE.xml" -ResourceFolder "D:\"
}
elseif($languageID -eq 1033)
{
Write-Output "Connected to EN site"
Invoke-PnPSiteTemplate -Path "D:\TemplateEN.xml" -ResourceFolder "D:\"
}
elseif($languageID -eq 1048)
{
Write-Output "Connected to RO site"
Invoke-PnPSiteTemplate -Path "D:\TemplateRO.xml" -ResourceFolder "D:\"
}
Now problem here is that i can not keep above regional settings in site script otherwise it will always set same regional settings here.
If i am removing setregionalsettings action from site script then also default regional setting of UTC 8:00 with locale DE is getting set.
When we apply the template using the below command directly without using site script from PnP powershell regional settings are applied according to source template
Connect-PnPOnline -URL "BaseTemplateSiteURL"
Get-PnPSiteTemplate -Out "D:\templateCustom.xml" -Handlers "Lists" -ExcludeHandlers "SiteSecurity,TermGroups,Fields,ContentTypes,Navigation" -PersistBrandingFiles -IncludeAllPages -Force
Connect-PnPOnline -URL "CustomTemplateAppliedSiteURL"
Invoke-PnPSiteTemplate -Path "C:\templateCustom.xml" -ResourceFolder "C:\"
but, when we are applying the template using the siteScript, the default regional settings for the selected language not applied.
Thanks,
Nikhil