diff --git a/ConfluencePS/Private/Copy-CommonParameter.ps1 b/ConfluencePS/Private/Copy-CommonParameter.ps1 index 6a825e1..01c8a24 100644 --- a/ConfluencePS/Private/Copy-CommonParameter.ps1 +++ b/ConfluencePS/Private/Copy-CommonParameter.ps1 @@ -31,7 +31,7 @@ function Copy-CommonParameter { [string[]]$AdditionalParameter, [Parameter(Mandatory = $false)] - [string[]]$DefaultParameter = @("Credential", "Certificate") + [string[]]$DefaultParameter = @("Credential", "Certificate","PersonalAccessToken") ) [hashtable]$ht = @{} diff --git a/ConfluencePS/Private/Invoke-WebRequest.ps1 b/ConfluencePS/Private/Invoke-WebRequest.ps1 index 2d25358..bf2e2b2 100644 --- a/ConfluencePS/Private/Invoke-WebRequest.ps1 +++ b/ConfluencePS/Private/Invoke-WebRequest.ps1 @@ -31,6 +31,9 @@ function Invoke-WebRequest { [System.Management.Automation.CredentialAttribute()] ${Credential}, + [string] + ${PersonalAccessToken}, + [switch] ${UseDefaultCredentials}, @@ -101,6 +104,11 @@ function Invoke-WebRequest { $null = $PSBoundParameters.Remove("Credential") } + if ($PersonalAccessToken) { + $PSBoundParameters["Headers"]["Authorization"] = "Bearer $PersonalAccessToken" + $null = $PSBoundParameters.Remove("PersonalAccessToken") + } + if ($InFile) { $boundary = [System.Guid]::NewGuid().ToString() $enc = [System.Text.Encoding]::GetEncoding("iso-8859-1") @@ -296,6 +304,8 @@ if ($PSVersionTable.PSVersion.Major -ge 6) { begin { if ($Credential -and (-not ($Authentication))) { $PSBoundParameters["Authentication"] = "Basic" + } elseif ($PersonalAccessToken -and (-not ($Authentication))) { + $PSBoundParameters["Authentication"] = "Bearer" } if ($InFile) { $multipartContent = [System.Net.Http.MultipartFormDataContent]::new() diff --git a/ConfluencePS/Public/Add-Attachment.ps1 b/ConfluencePS/Public/Add-Attachment.ps1 index 8d84c44..5659e30 100644 --- a/ConfluencePS/Public/Add-Attachment.ps1 +++ b/ConfluencePS/Public/Add-Attachment.ps1 @@ -6,11 +6,15 @@ function Add-Attachment { [OutputType([ConfluencePS.Attachment])] param( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -26,7 +30,11 @@ function Add-Attachment { [Alias('ID')] [UInt64]$PageID, - [Parameter( Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName )] + [Parameter( + Mandatory = $true, + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true + )] [ValidateScript( { if (-not (Test-Path $_ -PathType Leaf)) { diff --git a/ConfluencePS/Public/Add-Label.ps1 b/ConfluencePS/Public/Add-Label.ps1 index 3d4c9a2..2bf26e6 100644 --- a/ConfluencePS/Public/Add-Label.ps1 +++ b/ConfluencePS/Public/Add-Label.ps1 @@ -6,11 +6,15 @@ function Add-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 index 7931ef3..d09969c 100644 --- a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 +++ b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 @@ -3,11 +3,15 @@ function ConvertTo-StorageFormat { [OutputType([String])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -18,7 +22,7 @@ function ConvertTo-StorageFormat { Mandatory = $true, ValueFromPipeline = $true )] - [string[]]$Content + [String[]]$Content ) BEGIN { diff --git a/ConfluencePS/Public/ConvertTo-Table.ps1 b/ConfluencePS/Public/ConvertTo-Table.ps1 index 5771872..c4cc67a 100644 --- a/ConfluencePS/Public/ConvertTo-Table.ps1 +++ b/ConfluencePS/Public/ConvertTo-Table.ps1 @@ -28,8 +28,8 @@ function ConvertTo-Table { # This ForEach needed if the content wasn't piped in $Content | ForEach-Object { if ($Vertical) { - if ($HeaderGenerated) {$pipe = '|'} - else {$pipe = '||'} + if ($HeaderGenerated) { $pipe = '|' } + else { $pipe = '||' } # Put an empty row between multiple tables (objects) if ($Spacer) { diff --git a/ConfluencePS/Public/Get-Attachment.ps1 b/ConfluencePS/Public/Get-Attachment.ps1 index 804f265..39e3571 100644 --- a/ConfluencePS/Public/Get-Attachment.ps1 +++ b/ConfluencePS/Public/Get-Attachment.ps1 @@ -3,11 +3,15 @@ function Get-Attachment { [OutputType([ConfluencePS.Attachment])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Get-AttachmentFile.ps1 b/ConfluencePS/Public/Get-AttachmentFile.ps1 index b0e92df..b80672f 100644 --- a/ConfluencePS/Public/Get-AttachmentFile.ps1 +++ b/ConfluencePS/Public/Get-AttachmentFile.ps1 @@ -3,11 +3,15 @@ function Get-AttachmentFile { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -59,8 +63,8 @@ function Get-AttachmentFile { foreach ($_Attachment in $Attachment) { $iwParameters['Uri'] = $_Attachment.URL - $iwParameters['Headers'] = @{"Accept" = $_Attachment.MediaType} - $iwParameters['OutFile'] = if ($Path) {Join-Path -Path $Path -ChildPath $_Attachment.Filename} else {$_Attachment.Filename} + $iwParameters['Headers'] = @{"Accept" = $_Attachment.MediaType } + $iwParameters['OutFile'] = if ($Path) { Join-Path -Path $Path -ChildPath $_Attachment.Filename } else { $_Attachment.Filename } $result = Invoke-Method @iwParameters (-not $result) diff --git a/ConfluencePS/Public/Get-ChildPage.ps1 b/ConfluencePS/Public/Get-ChildPage.ps1 index ddacf28..6fe9f84 100644 --- a/ConfluencePS/Public/Get-ChildPage.ps1 +++ b/ConfluencePS/Public/Get-ChildPage.ps1 @@ -3,11 +3,15 @@ function Get-ChildPage { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -23,12 +27,12 @@ function Get-ChildPage { [Alias('ID')] [UInt64]$PageID, - [switch]$Recurse, + [Switch]$Recurse, [ValidateRange(1, [UInt32]::MaxValue)] [UInt32]$PageSize = 25, - [switch]$ExcludePageBody + [Switch]$ExcludePageBody ) BEGIN { diff --git a/ConfluencePS/Public/Get-Label.ps1 b/ConfluencePS/Public/Get-Label.ps1 index 06e971d..e07aa80 100644 --- a/ConfluencePS/Public/Get-Label.ps1 +++ b/ConfluencePS/Public/Get-Label.ps1 @@ -5,11 +5,15 @@ function Get-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Get-Page.ps1 b/ConfluencePS/Public/Get-Page.ps1 index 6d17034..a677a94 100644 --- a/ConfluencePS/Public/Get-Page.ps1 +++ b/ConfluencePS/Public/Get-Page.ps1 @@ -6,11 +6,15 @@ function Get-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -34,7 +38,7 @@ function Get-Page { ParameterSetName = "bySpaceObject" )] [Alias('Name')] - [string]$Title, + [String]$Title, [Parameter( Mandatory = $true, @@ -44,7 +48,7 @@ function Get-Page { ParameterSetName = "byLabel" )] [Alias('Key')] - [string]$SpaceKey, + [String]$SpaceKey, [Parameter( Mandatory = $true, @@ -62,19 +66,19 @@ function Get-Page { Mandatory = $true, ParameterSetName = "byLabel" )] - [string[]]$Label, + [String[]]$Label, [Parameter( Position = 0, Mandatory = $true, ParameterSetName = "byQuery" )] - [string]$Query, + [String]$Query, [ValidateRange(1, [UInt32]::MaxValue)] [UInt32]$PageSize = 25, - [switch]$ExcludePageBody + [Switch]$ExcludePageBody ) BEGIN { diff --git a/ConfluencePS/Public/Get-Space.ps1 b/ConfluencePS/Public/Get-Space.ps1 index 447c395..505f989 100644 --- a/ConfluencePS/Public/Get-Space.ps1 +++ b/ConfluencePS/Public/Get-Space.ps1 @@ -5,11 +5,15 @@ function Get-Space { [OutputType([ConfluencePS.Space])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -19,7 +23,7 @@ function Get-Space { Position = 0 )] [Alias('Key')] - [string[]]$SpaceKey, + [String[]]$SpaceKey, [ValidateRange(1, [UInt32]::MaxValue)] [UInt32]$PageSize = 25 diff --git a/ConfluencePS/Public/Invoke-Method.ps1 b/ConfluencePS/Public/Invoke-Method.ps1 index 4fb0447..f2dde6c 100644 --- a/ConfluencePS/Public/Invoke-Method.ps1 +++ b/ConfluencePS/Public/Invoke-Method.ps1 @@ -12,8 +12,11 @@ function Invoke-Method { )] [Diagnostics.CodeAnalysis.SuppressMessageAttribute( "PSAvoidUsingEmptyCatchBlock", "" )] param ( - [Parameter(Mandatory = $true)] - [uri]$Uri, + [Parameter( + Position = 0, + Mandatory = $true + )] + [Uri]$Uri, [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = "GET", @@ -44,6 +47,10 @@ function Invoke-Method { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/New-Page.ps1 b/ConfluencePS/Public/New-Page.ps1 index fdd88de..6329637 100644 --- a/ConfluencePS/Public/New-Page.ps1 +++ b/ConfluencePS/Public/New-Page.ps1 @@ -7,11 +7,15 @@ function New-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -30,24 +34,26 @@ function New-Page { ParameterSetName = 'byParameters' )] [Alias('Name')] - [string]$Title, + [String]$Title, [Parameter(ParameterSetName = 'byParameters')] [ValidateRange(1, [UInt64]::MaxValue)] [UInt64]$ParentID, + [Parameter(ParameterSetName = 'byParameters')] [ConfluencePS.Page]$Parent, [Parameter(ParameterSetName = 'byParameters')] - [string]$SpaceKey, + [String]$SpaceKey, + [Parameter(ParameterSetName = 'byParameters')] [ConfluencePS.Space]$Space, [Parameter(ParameterSetName = 'byParameters')] - [string]$Body, + [String]$Body, [Parameter(ParameterSetName = 'byParameters')] - [switch]$Convert + [Switch]$Convert ) BEGIN { diff --git a/ConfluencePS/Public/New-Space.ps1 b/ConfluencePS/Public/New-Space.ps1 index 12af165..4308792 100644 --- a/ConfluencePS/Public/New-Space.ps1 +++ b/ConfluencePS/Public/New-Space.ps1 @@ -7,11 +7,15 @@ function New-Space { [OutputType([ConfluencePS.Space])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -29,18 +33,18 @@ function New-Space { ParameterSetName = "byProperties" )] [Alias('Key')] - [string]$SpaceKey, + [String]$SpaceKey, [Parameter( Mandatory = $true, ParameterSetName = "byProperties" )] - [string]$Name, + [String]$Name, [Parameter( ParameterSetName = "byProperties" )] - [string]$Description + [String]$Description ) BEGIN { diff --git a/ConfluencePS/Public/Remove-Attachment.ps1 b/ConfluencePS/Public/Remove-Attachment.ps1 index 868fe70..9a715dc 100644 --- a/ConfluencePS/Public/Remove-Attachment.ps1 +++ b/ConfluencePS/Public/Remove-Attachment.ps1 @@ -6,11 +6,15 @@ function Remove-Attachment { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Remove-Label.ps1 b/ConfluencePS/Public/Remove-Label.ps1 index ff8813e..ab7639b 100644 --- a/ConfluencePS/Public/Remove-Label.ps1 +++ b/ConfluencePS/Public/Remove-Label.ps1 @@ -6,11 +6,15 @@ function Remove-Label { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -27,7 +31,7 @@ function Remove-Label { [UInt64[]]$PageID, [Parameter()] - [string[]]$Label + [String[]]$Label ) BEGIN { diff --git a/ConfluencePS/Public/Remove-Page.ps1 b/ConfluencePS/Public/Remove-Page.ps1 index 23d20f1..73135d6 100644 --- a/ConfluencePS/Public/Remove-Page.ps1 +++ b/ConfluencePS/Public/Remove-Page.ps1 @@ -6,11 +6,15 @@ function Remove-Page { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Remove-Space.ps1 b/ConfluencePS/Public/Remove-Space.ps1 index dac66e6..75330c2 100644 --- a/ConfluencePS/Public/Remove-Space.ps1 +++ b/ConfluencePS/Public/Remove-Space.ps1 @@ -7,11 +7,15 @@ function Remove-Space { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssignments', '')] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -24,9 +28,9 @@ function Remove-Space { ValueFromPipelineByPropertyName = $true )] [Alias('Key')] - [string[]]$SpaceKey, + [String[]]$SpaceKey, - [switch]$Force + [Switch]$Force # TODO: Probably an extra param later to loop checking the status & wait for completion? ) diff --git a/ConfluencePS/Public/Set-Attachment.ps1 b/ConfluencePS/Public/Set-Attachment.ps1 index 0b733bf..ab4ab32 100644 --- a/ConfluencePS/Public/Set-Attachment.ps1 +++ b/ConfluencePS/Public/Set-Attachment.ps1 @@ -6,11 +6,15 @@ function Set-Attachment { [OutputType([ConfluencePS.Attachment])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -24,7 +28,7 @@ function Set-Attachment { [ConfluencePS.Attachment]$Attachment, # Path of the file to upload and attach - [Parameter( Mandatory )] + [Parameter( Mandatory = $true )] [ValidateScript( { if (-not (Test-Path $_ -PathType Leaf)) { diff --git a/ConfluencePS/Public/Set-Info.ps1 b/ConfluencePS/Public/Set-Info.ps1 index f46bb38..e8e8eff 100644 --- a/ConfluencePS/Public/Set-Info.ps1 +++ b/ConfluencePS/Public/Set-Info.ps1 @@ -5,13 +5,15 @@ function Set-Info { [Parameter( HelpMessage = 'Example = https://brianbunke.atlassian.net/wiki (/wiki for Cloud instances)' )] - [uri]$BaseURi, + [Uri]$BaseURi, [PSCredential]$Credential, + [String]$PersonalAccessToken, + [UInt32]$PageSize, - [switch]$PromptCredentials + [Switch]$PromptCredentials ) BEGIN { @@ -19,10 +21,10 @@ function Set-Info { function Add-ConfluenceDefaultParameter { param( [Parameter(Mandatory = $true)] - [string]$Command, + [String]$Command, [Parameter(Mandatory = $true)] - [string]$Parameter, + [String]$Parameter, [Parameter(Mandatory = $true)] $Value @@ -58,6 +60,11 @@ function Set-Info { Add-ConfluenceDefaultParameter -Command $command -Parameter $parameter -Value $Credential } + $parameter = "PersonalAccessToken" + if ($PersonalAccessToken -and ($command.Parameters.Keys -contains $parameter)) { + Add-ConfluenceDefaultParameter -Command $command -Parameter $parameter -Value $PersonalAccessToken + } + $parameter = "PageSize" if ($PageSize -and ($command.Parameters.Keys -contains $parameter)) { Add-ConfluenceDefaultParameter -Command $command -Parameter $parameter -Value $PageSize diff --git a/ConfluencePS/Public/Set-Label.ps1 b/ConfluencePS/Public/Set-Label.ps1 index b4f5cd4..8c59e39 100644 --- a/ConfluencePS/Public/Set-Label.ps1 +++ b/ConfluencePS/Public/Set-Label.ps1 @@ -6,11 +6,15 @@ function Set-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -26,8 +30,8 @@ function Set-Label { [Alias('ID')] [UInt64[]]$PageID, - [Parameter(Mandatory = $true)] - [string[]]$Label + [Parameter( Mandatory = $true )] + [String[]]$Label ) BEGIN { diff --git a/ConfluencePS/Public/Set-Page.ps1 b/ConfluencePS/Public/Set-Page.ps1 index 69d58a7..4516c64 100644 --- a/ConfluencePS/Public/Set-Page.ps1 +++ b/ConfluencePS/Public/Set-Page.ps1 @@ -7,11 +7,15 @@ function Set-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [String] + $PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -35,13 +39,13 @@ function Set-Page { [Parameter(ParameterSetName = 'byParameters')] [ValidateNotNullOrEmpty()] - [string]$Title, + [String]$Title, [Parameter(ParameterSetName = 'byParameters')] - [string]$Body, + [String]$Body, [Parameter(ParameterSetName = 'byParameters')] - [switch]$Convert, + [Switch]$Convert, [Parameter(ParameterSetName = 'byParameters')] [ValidateRange(1, [UInt64]::MaxValue)] diff --git a/Tests/Build.Tests.ps1 b/Tests/Build.Tests.ps1 index fdffedc..bcdb4ac 100644 --- a/Tests/Build.Tests.ps1 +++ b/Tests/Build.Tests.ps1 @@ -60,7 +60,7 @@ Describe "Validation of build environment" -Tag Unit { } It "has a version changelog that matches the manifest version" { - Configuration\Get-Metadata -Path $env:BHManifestToTest -PropertyName ModuleVersion | Should -BeLike "$changelogVersion*" + (Metadata\Import-Metadata -Path $env:BHManifestToTest).ModuleVersion | Should -BeLike "$changelogVersion*" } } } diff --git a/docs/en-US/commands/Add-Attachment.md b/docs/en-US/commands/Add-Attachment.md index b32594f..bc2ed1d 100644 --- a/docs/en-US/commands/Add-Attachment.md +++ b/docs/en-US/commands/Add-Attachment.md @@ -16,7 +16,9 @@ Add a new attachment to an existing Confluence page. ## SYNTAX ```powershell -Add-ConfluenceAttachment -ApiUri -Credential [[-PageID] ] -FilePath [-WhatIf] [-Confirm] +Add-ConfluenceAttachment -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] -FilePath [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -82,6 +84,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Add-Label.md b/docs/en-US/commands/Add-Label.md index 4c04829..844c08a 100644 --- a/docs/en-US/commands/Add-Label.md +++ b/docs/en-US/commands/Add-Label.md @@ -16,7 +16,9 @@ Add a new global label to an existing Confluence page. ## SYNTAX ```powershell -Add-ConfluenceLabel -ApiUri -Credential [[-PageID] ] -Label [-WhatIf] [-Confirm] +Add-ConfluenceLabel -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] -Label [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -91,6 +93,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/ConvertTo-StorageFormat.md b/docs/en-US/commands/ConvertTo-StorageFormat.md index 06c8a22..f1a0f88 100644 --- a/docs/en-US/commands/ConvertTo-StorageFormat.md +++ b/docs/en-US/commands/ConvertTo-StorageFormat.md @@ -16,7 +16,8 @@ Convert your content to Confluence's storage format. ## SYNTAX ```powershell -ConvertTo-ConfluenceStorageFormat -ApiUri -Credential [-Content] +ConvertTo-ConfluenceStorageFormat -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] [-Content] ``` ## DESCRIPTION @@ -79,6 +80,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Get-Attachment.md b/docs/en-US/commands/Get-Attachment.md index c665a1b..911903c 100644 --- a/docs/en-US/commands/Get-Attachment.md +++ b/docs/en-US/commands/Get-Attachment.md @@ -16,7 +16,10 @@ Retrieve the child Attachments of a given wiki Page. ## SYNTAX ```powershell -Get-ConfluenceAttachment -ApiUri -Credential [-PageID] [-FileNameFilter ] [-MediaTypeFilter ] [-Skip ] [-First ] [-PageSize ] [-IncludeTotalCount] +Get-ConfluenceAttachment -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-FileNameFilter ] [-MediaTypeFilter ] + [-Skip ] [-First ] [-PageSize ] [-IncludeTotalCount] ``` ## DESCRIPTION @@ -97,6 +100,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Get-AttachmentFile.md b/docs/en-US/commands/Get-AttachmentFile.md index d844f72..44fdbc8 100644 --- a/docs/en-US/commands/Get-AttachmentFile.md +++ b/docs/en-US/commands/Get-AttachmentFile.md @@ -16,7 +16,9 @@ Retrieves the binary Attachment for a given Attachment object. ## SYNTAX ```powershell -Get-ConfluenceAttachmentFile -ApiUri -Credential [-Attachment] [-Path ] +Get-ConfluenceAttachmentFile -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Attachment] [-Path ] ``` ## DESCRIPTION @@ -82,6 +84,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Get-ChildPage.md b/docs/en-US/commands/Get-ChildPage.md index 5f47b81..ba8d779 100644 --- a/docs/en-US/commands/Get-ChildPage.md +++ b/docs/en-US/commands/Get-ChildPage.md @@ -16,7 +16,10 @@ Retrieve the child pages of a given wiki page or pages. ## SYNTAX ```powershell -Get-ConfluenceChildPage -ApiUri -Credential [-PageID] [-Recurse] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluenceChildPage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-Recurse] [-PageSize ] [-IncludeTotalCount] + [-Skip ] [-First ] [-ExcludePageBody] ``` ## DESCRIPTION @@ -83,6 +86,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Get-Label.md b/docs/en-US/commands/Get-Label.md index abfecaf..7152b5b 100644 --- a/docs/en-US/commands/Get-Label.md +++ b/docs/en-US/commands/Get-Label.md @@ -16,8 +16,10 @@ Retrieve all labels applied to the given object(s). ## SYNTAX ```powershell -Get-ConfluenceLabel -ApiUri -Credential [-PageID] [-PageSize ] - [-IncludeTotalCount] [-Skip ] [-First ] +Get-ConfluenceLabel -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-PageSize ] [-IncludeTotalCount] + [-Skip ] [-First ] ``` ## DESCRIPTION @@ -80,6 +82,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Get-Page.md b/docs/en-US/commands/Get-Page.md index 0465c21..c50be87 100644 --- a/docs/en-US/commands/Get-Page.md +++ b/docs/en-US/commands/Get-Page.md @@ -18,31 +18,46 @@ Retrieve a listing of pages in your Confluence instance. ### byId (Default) ```powershell -Get-ConfluencePage -ApiUri -Credential [-PageID] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-PageSize ] [-IncludeTotalCount] [-Skip ] + [-First ] [-ExcludePageBody] ``` ### byLabel ```powershell -Get-ConfluencePage -ApiUri -Credential [-SpaceKey ] [-Space ] -Label [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-SpaceKey ] [-Space ] -Label [-PageSize ] + [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] ``` ### bySpace ```powershell -Get-ConfluencePage -ApiUri -Credential -SpaceKey [-Title ] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -SpaceKey [-Title ] [-PageSize ] [-IncludeTotalCount] + [-Skip ] [-First ] [-ExcludePageBody] ``` ### byQuery ```powershell -Get-ConfluencePage -ApiUri -Credential [-Query ] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Query] [-PageSize ] [-IncludeTotalCount] [-Skip ] + [-First ] [-ExcludePageBody] ``` ### bySpaceObject ```powershell -Get-ConfluencePage -ApiUri -Credential -Space [-Title ] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] [-ExcludePageBody] +Get-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -Space [-Title ] [-PageSize ] [-IncludeTotalCount] + [-Skip ] [-First ] [-ExcludePageBody] ``` ## DESCRIPTION @@ -141,6 +156,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate to use for the authentication with the REST Api. diff --git a/docs/en-US/commands/Get-Space.md b/docs/en-US/commands/Get-Space.md index e95efce..c88f5be 100644 --- a/docs/en-US/commands/Get-Space.md +++ b/docs/en-US/commands/Get-Space.md @@ -17,7 +17,10 @@ Retrieve a listing of spaces in your Confluence instance. ## SYNTAX ```powershell -Get-ConfluenceSpace -ApiUri -Credential [[-SpaceKey] ] [-PageSize ] [-IncludeTotalCount] [-Skip ] [-First ] +Get-ConfluenceSpace -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [[-SpaceKey] ] [-PageSize ] [-IncludeTotalCount] + [-Skip ] [-First ] ``` ## DESCRIPTION @@ -90,6 +93,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Invoke-Method.md b/docs/en-US/commands/Invoke-Method.md index 75adf56..e1930bd 100644 --- a/docs/en-US/commands/Invoke-Method.md +++ b/docs/en-US/commands/Invoke-Method.md @@ -17,10 +17,12 @@ Invoke a specific call to a Confluence REST Api endpoint ## SYNTAX ```powershell -Invoke-ConfluenceMethod [-URi] [[-Method] ] [[-Body] ] [-RawBody] - [[-Headers] ] [[-GetParameters] ] [[-InFile] ] [[-OutFile] ] - [[-OutputType] ] [-Credential] [[-Caller] ] [-IncludeTotalCount] [-Skip ] - [-First ] [] +Invoke-ConfluenceMethod [-URi] [-Method ] [-Body ] + [-RawBody] [-Headers ] [-GetParameters ] [-InFile ] + [-OutFile ] [-OutputType ] [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Caller ] [-IncludeTotalCount] [-Skip ] [-First ] + [] ``` ## DESCRIPTION @@ -224,7 +226,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -244,7 +246,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -262,7 +264,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -280,7 +282,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -299,7 +301,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -317,7 +319,23 @@ Parameter Sets: (All) Aliases: Required: False -Position: 9 +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PersonalAccessToken + +The PersonalAccessToken you created in your Confluence User Settings. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -335,7 +353,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 10 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -351,7 +369,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 11 +Position: Named Default value: $PSCmdlet Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/en-US/commands/New-Page.md b/docs/en-US/commands/New-Page.md index 6b103c2..c8ea229 100644 --- a/docs/en-US/commands/New-Page.md +++ b/docs/en-US/commands/New-Page.md @@ -18,13 +18,18 @@ Create a new page on your Confluence instance. ### byParameters (Default) ```powershell -New-ConfluencePage -ApiUri -Credential -Title [-ParentID ] [-Parent ] [-SpaceKey ] [-Space ] [-Body ] [-Convert] [-WhatIf] [-Confirm] +New-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -Title [-ParentID ] [-Parent ] [-SpaceKey ] + [-Space ] [-Body ] [-Convert] [-WhatIf] [-Confirm] ``` ### byObject ```powershell -New-ConfluencePage -ApiUri -Credential -InputObject [-WhatIf] [-Confirm] +New-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -InputObject [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -138,6 +143,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/New-Space.md b/docs/en-US/commands/New-Space.md index 62a6019..01e70b5 100644 --- a/docs/en-US/commands/New-Space.md +++ b/docs/en-US/commands/New-Space.md @@ -18,14 +18,17 @@ Create a new blank space on your Confluence instance. ### byObject (Default) ```powershell -New-ConfluenceSpace -ApiUri -Credential -InputObject [-WhatIf] [-Confirm] +New-ConfluenceSpace -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -InputObject [-WhatIf] [-Confirm] ``` ### byProperties ```powershell -New-ConfluenceSpace -ApiUri -Credential -SpaceKey -Name - [-Description ] [-WhatIf] [-Confirm] +New-ConfluenceSpace -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -SpaceKey -Name [-Description ] [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -99,6 +102,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Remove-Attachment.md b/docs/en-US/commands/Remove-Attachment.md index 1e2fe2a..0df2881 100644 --- a/docs/en-US/commands/Remove-Attachment.md +++ b/docs/en-US/commands/Remove-Attachment.md @@ -16,7 +16,9 @@ Remove an Attachment. ## SYNTAX ```powershell -Remove-ConfluenceAttachment -ApiUri -Credential [-Attachment] [-WhatIf] [-Confirm] +Remove-ConfluenceAttachment -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Attachment] [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -91,6 +93,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Remove-Label.md b/docs/en-US/commands/Remove-Label.md index c8dcf80..d621945 100644 --- a/docs/en-US/commands/Remove-Label.md +++ b/docs/en-US/commands/Remove-Label.md @@ -16,7 +16,9 @@ Remove a label from existing Confluence content. ## SYNTAX ```powershell -Remove-ConfluenceLabel -ApiUri -Credential [-PageID] [-Label ] [-WhatIf] [-Confirm] +Remove-ConfluenceLabel -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-Label ] [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -91,6 +93,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Remove-Page.md b/docs/en-US/commands/Remove-Page.md index 7d66172..a61b319 100644 --- a/docs/en-US/commands/Remove-Page.md +++ b/docs/en-US/commands/Remove-Page.md @@ -16,7 +16,9 @@ Trash an existing Confluence page. ## SYNTAX ```powershell -Remove-ConfluencePage -ApiUri -Credential [-PageID] [-WhatIf] [-Confirm] +Remove-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -91,6 +93,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Remove-Space.md b/docs/en-US/commands/Remove-Space.md index 612bf10..a22bd40 100644 --- a/docs/en-US/commands/Remove-Space.md +++ b/docs/en-US/commands/Remove-Space.md @@ -16,7 +16,9 @@ Remove an existing Confluence space. ## SYNTAX ```powershell -Remove-ConfluenceSpace -ApiUri -Credential [-SpaceKey] [-Force] [-WhatIf] [-Confirm] +Remove-ConfluenceSpace -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-SpaceKey] [-Force] [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -83,6 +85,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Set-Attachment.md b/docs/en-US/commands/Set-Attachment.md index f0d328b..f90c27d 100644 --- a/docs/en-US/commands/Set-Attachment.md +++ b/docs/en-US/commands/Set-Attachment.md @@ -16,7 +16,9 @@ Updates an existing attachment with a new file. ## SYNTAX ```powershell -Set-ConfluenceAttachment -ApiUri -Credential [-Attachment] -FilePath [-WhatIf] [-Confirm] +Set-ConfluenceAttachment -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Attachment] -FilePath [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -79,6 +81,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Set-Info.md b/docs/en-US/commands/Set-Info.md index 26559d5..a85e125 100644 --- a/docs/en-US/commands/Set-Info.md +++ b/docs/en-US/commands/Set-Info.md @@ -16,7 +16,9 @@ Specify wiki location and authorization for use in this session's REST API reque ## SYNTAX ```powershell -Set-ConfluenceInfo [[-BaseURi] ] [[-Credential] ] [[-PageSize] ] [-PromptCredentials] +Set-ConfluenceInfo [-BaseURi ] [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageSize ] [-PromptCredentials] ``` ## DESCRIPTION @@ -70,6 +72,16 @@ Set-ConfluenceInfo -BaseURI 'https://wiki.yourcompany.com' -Credential $Cred Declare the URI of your Confluence instance and the credentials (username and password). +### -------------------------- EXAMPLE 5 -------------------------- + +```powershell +$Pat = 'NDU1MTk4NzUyNTg3Om1I/FR61TJBC8hhJKXpOgJBC0Jk' +Set-ConfluenceInfo -BaseURI 'https://wiki.yourcompany.com' -PersonalAccessToken $Pat +``` + +Declare the URI of your Confluence instance and the Personal Access Token. +See: + ## PARAMETERS ### -BaseURi @@ -83,7 +95,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -99,7 +111,23 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PersonalAccessToken + +The PersonalAccessToken you created in your Confluence User Settings. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -116,7 +144,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/en-US/commands/Set-Label.md b/docs/en-US/commands/Set-Label.md index 90b2fb2..7d66071 100644 --- a/docs/en-US/commands/Set-Label.md +++ b/docs/en-US/commands/Set-Label.md @@ -16,7 +16,9 @@ Set the labels applied to existing Confluence content. ## SYNTAX ```powershell -Set-Label -ApiUri -Credential [-PageID] -Label [-WhatIf] [-Confirm] +Set-Label -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageID] -Label [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -82,6 +84,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication. diff --git a/docs/en-US/commands/Set-Page.md b/docs/en-US/commands/Set-Page.md index e828f81..b7717b2 100644 --- a/docs/en-US/commands/Set-Page.md +++ b/docs/en-US/commands/Set-Page.md @@ -18,13 +18,18 @@ Edit an existing Confluence page. ### byParameters (Default) ```powershell -Set-ConfluencePage -ApiUri -Credential -PageID [-Title ] [-Body ] [-Convert] [-ParentID ] [-Parent ] [-WhatIf] [-Confirm] +Set-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -PageID [-Title ] [-Body ] [-Convert] + [-ParentID ] [-Parent ] [-WhatIf] [-Confirm] ``` ### byObject ```powershell -Set-ConfluencePage -ApiUri -Credential -InputObject [-WhatIf] [-Confirm] +Set-ConfluencePage -ApiUri [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + -InputObject [-WhatIf] [-Confirm] ``` ## DESCRIPTION @@ -111,6 +116,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PersonalAccessToken + +Confluence's Personal Access Token for authentication. +Value can be set persistently with Set-ConfluenceInfo. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Certificate Certificate for authentication.