Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying changes from PR3715 #3741

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Changed

- `-IsFavoriteByDefault` parameter is now obsolete in `Add-PnPTeamsChannel` cmdlet due to deprecation by Microsoft Graph API. [#3712](https://github.com/pnp/powershell/pull/3712)
- `Get-PnPSiteTemplate` will now only contain `PersistPublishingFiles`, `IncludeNativePublishingFiles`, `IncludeTermGroupsSecurity`, `IncludeSearchConfiguration`, `SkipVersionCheck` and `PersistMultiLanguageResources` if these are provided with the cmdlet as switch parameters [#3715](https://github.com/pnp/powershell/pull/3715)

### Contributors

- Nils Andresen [nils-a]
- Gautam Sheth [gautamdsheth]
- Nishkalank Bezawada [NishkalankBezawada]
- Konrad K. [wilecoyotegenius]
Expand Down
32 changes: 25 additions & 7 deletions src/Commands/Provisioning/Site/GetSiteTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,26 @@ private void ExtractTemplate(XMLPnPSchemaVersion schema, string path, string pac
creationInformation.PersistBrandingFiles = PersistBrandingFiles;
}
#pragma warning restore 618
creationInformation.PersistPublishingFiles = PersistPublishingFiles;
creationInformation.IncludeNativePublishingFiles = IncludeNativePublishingFiles;
if (ParameterSpecified(nameof(PersistPublishingFiles)))
{
creationInformation.PersistPublishingFiles = PersistPublishingFiles;
}
if (ParameterSpecified(nameof(IncludeNativePublishingFiles)))
{
creationInformation.IncludeNativePublishingFiles = IncludeNativePublishingFiles;
}
if (ParameterSpecified(nameof(IncludeSiteGroups)))
{
creationInformation.IncludeSiteGroups = IncludeSiteGroups;
}
creationInformation.IncludeTermGroupsSecurity = IncludeTermGroupsSecurity;
creationInformation.IncludeSearchConfiguration = IncludeSearchConfiguration;
if (ParameterSpecified(nameof(IncludeTermGroupsSecurity)))
{
creationInformation.IncludeTermGroupsSecurity = IncludeTermGroupsSecurity;
}
if (ParameterSpecified(nameof(IncludeSearchConfiguration)))
{
creationInformation.IncludeSearchConfiguration = IncludeSearchConfiguration;
}
if (ParameterSpecified(nameof(IncludeHiddenLists)))
{
creationInformation.IncludeHiddenLists = IncludeHiddenLists;
Expand All @@ -229,12 +241,18 @@ private void ExtractTemplate(XMLPnPSchemaVersion schema, string path, string pac
{
creationInformation.IncludeAllClientSidePages = IncludeAllPages;
}
creationInformation.SkipVersionCheck = SkipVersionCheck;
if (ParameterSpecified(nameof(SkipVersionCheck)))
{
creationInformation.SkipVersionCheck = SkipVersionCheck;
}
if (ParameterSpecified(nameof(ContentTypeGroups)) && ContentTypeGroups != null)
{
creationInformation.ContentTypeGroupsToInclude = ContentTypeGroups.ToList();
}
creationInformation.PersistMultiLanguageResources = PersistMultiLanguageResources;
if (ParameterSpecified(nameof(PersistMultiLanguageResources)) && ContentTypeGroups != null)
{
creationInformation.PersistMultiLanguageResources = PersistMultiLanguageResources;
}
if (extension == ".pnp")
{
// if file is of pnp format, persist all files
Expand Down Expand Up @@ -436,4 +454,4 @@ public static void SetTemplateMetadata(ProvisioningTemplate template, string tem
}
}
}
}
}
Loading