refactor: update samples to reflect xconfluencebuilder update
This commit is contained in:
parent
5637e73b10
commit
5c8b85f75d
5 changed files with 43 additions and 3 deletions
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
|
@ -15,19 +15,19 @@
|
||||||
"Name": "pexels-just-a-couple-photos-3777622.jpg",
|
"Name": "pexels-just-a-couple-photos-3777622.jpg",
|
||||||
"ContainerPageTitle": "Cats",
|
"ContainerPageTitle": "Cats",
|
||||||
"MimeType": "image/jpeg",
|
"MimeType": "image/jpeg",
|
||||||
"Ref": "attachments/pexels-just-a-couple-photos-3777622.jpg"
|
"Ref": "attachments/Cats/pexels-just-a-couple-photos-3777622.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "pexels-sami-aksu-14356302.jpg",
|
"Name": "pexels-sami-aksu-14356302.jpg",
|
||||||
"ContainerPageTitle": "Cats",
|
"ContainerPageTitle": "Cats",
|
||||||
"MimeType": "image/jpeg",
|
"MimeType": "image/jpeg",
|
||||||
"Ref": "attachments/pexels-sami-aksu-14356302.jpg"
|
"Ref": "attachments/Cats/pexels-sami-aksu-14356302.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "objects.inv",
|
"Name": "objects.inv",
|
||||||
"ContainerPageTitle": "Default Sample~",
|
"ContainerPageTitle": "Default Sample~",
|
||||||
"MimeType": "application/octet-stream",
|
"MimeType": "application/octet-stream",
|
||||||
"Ref": "attachments/objects.inv"
|
"Ref": "attachments/Default+Sample~/objects.inv"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
40
samples/default/run.ps1
Executable file
40
samples/default/run.ps1
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue