refactor: update samples to reflect xconfluencebuilder update

This commit is contained in:
Rodweil, Theodor 2023-08-11 02:39:46 +02:00
parent 5637e73b10
commit 5c8b85f75d
5 changed files with 43 additions and 3 deletions

40
samples/default/run.ps1 Executable file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env pwsh
<#
.SYNOPSIS
default reference implementation
.DESCRIPTION
This script is a reference implementation for the basic usage of this
PowerShell module. It uses demo data which can be used to do a basic
integration test.
#>
Param(
[Parameter(Mandatory)] [String] $Hostname,
[Parameter(Mandatory)] [String] $Space,
[Parameter(Mandatory)] [String] $PersonalAccessToken,
[Parameter()] [String] $ManifestFile = 'data/manifest.json'
)
Import-Module "$PSScriptRoot/../../src/PSConfluencePublisher.psd1"
# create a high-level manifest pseudo-object
$manifest = Initialize-Manifest -Path $ManifestFile
# create a high-level connection pseudo-object
$connection = Initialize-Connection `
-Host $Hostname `
-Space $Space `
-PersonalAccessToken $PersonalAccessToken
# unidirectionally synchronize all remote metadata to local (in-memory) manifest
$manifest.Manifest.Pages = Get-PageMeta `
-Host $Hostname `
-Manifest $manifest.Manifest.Pages `
-Space $Space `
-Force
# write back to disk
Set-Manifest `
-Manifest $manifest.Manifest `
-File $manifest.Path `
-Backup $true