Skip to content
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
9 changes: 3 additions & 6 deletions documentation/Export-PnPPage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Exports a Client Side Page to a PnP Provisioning Template

```powershell
Export-PnPPage [-Identity] <PagePipeBind> [-PersistBrandingFiles] [-Out <String>] [-Force]
[-Configuration <ExtractConfigurationPipeBind>] [-Connection <PnPConnection>]
[-Configuration <ExtractConfigurationPipeBind>] [-OutputInstance] [-Connection <PnPConnection>]

```

Expand Down Expand Up @@ -141,15 +141,12 @@ Accept pipeline input: False
Accept wildcard characters: False
```



### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
### -OutputInstance
Returns the template as an in-memory object, which is an instance of the SiteTemplate type of the PnP Core Component. It cannot be used together with the -Out parameter.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Expand Down
13 changes: 11 additions & 2 deletions src/Commands/Pages/ExportPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class ExportPage : PnPWebCmdlet
[Parameter(Mandatory = false)]
public ExtractConfigurationPipeBind Configuration;

[Parameter(Mandatory = false)]
public SwitchParameter OutputInstance;

protected override void ProcessRecord()
{
_ = Identity.GetPage(Connection) ?? throw new Exception($"Page '{Identity?.Name}' does not exist");
Expand Down Expand Up @@ -95,9 +98,15 @@ private void ExtractTemplate(string dirName, string fileName, ExtractConfigurati
}
else
{
WriteObject(outputTemplate.ToXML());
if (OutputInstance)
{
WriteObject(outputTemplate);
}
else
{
WriteObject(outputTemplate.ToXML());
}
}
}
}

}
Loading