From 7e840011d24fb448d75f946041634825c94feb5c Mon Sep 17 00:00:00 2001 From: Mathew DeGauvin Date: Mon, 3 Jan 2022 14:15:21 -0800 Subject: [PATCH 1/7] Adding the personal access token parameters to functions --- ConfluencePS/Private/Copy-CommonParameter.ps1 | 2 +- ConfluencePS/Private/Invoke-WebRequest.ps1 | 10 ++++++++++ ConfluencePS/Public/Add-Attachment.ps1 | 3 +++ ConfluencePS/Public/Add-Label.ps1 | 3 +++ ConfluencePS/Public/ConvertTo-StorageFormat.ps1 | 3 +++ ConfluencePS/Public/ConvertTo-Table.ps1 | 4 ++-- ConfluencePS/Public/Get-Attachment.ps1 | 3 +++ ConfluencePS/Public/Get-AttachmentFile.ps1 | 7 +++++-- ConfluencePS/Public/Get-ChildPage.ps1 | 3 +++ ConfluencePS/Public/Get-Label.ps1 | 3 +++ ConfluencePS/Public/Get-Page.ps1 | 3 +++ ConfluencePS/Public/Get-Space.ps1 | 3 +++ ConfluencePS/Public/Invoke-Method.ps1 | 3 +++ ConfluencePS/Public/New-Page.ps1 | 3 +++ ConfluencePS/Public/New-Space.ps1 | 3 +++ ConfluencePS/Public/Remove-Attachment.ps1 | 3 +++ ConfluencePS/Public/Remove-Label.ps1 | 3 +++ ConfluencePS/Public/Remove-Page.ps1 | 3 +++ ConfluencePS/Public/Remove-Space.ps1 | 3 +++ ConfluencePS/Public/Set-Attachment.ps1 | 3 +++ ConfluencePS/Public/Set-Info.ps1 | 5 +++++ ConfluencePS/Public/Set-Label.ps1 | 3 +++ ConfluencePS/Public/Set-Page.ps1 | 3 +++ 23 files changed, 77 insertions(+), 5 deletions(-) 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..6ce87d8 100644 --- a/ConfluencePS/Public/Add-Attachment.ps1 +++ b/ConfluencePS/Public/Add-Attachment.ps1 @@ -11,6 +11,9 @@ function Add-Attachment { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Add-Label.ps1 b/ConfluencePS/Public/Add-Label.ps1 index 3d4c9a2..849877f 100644 --- a/ConfluencePS/Public/Add-Label.ps1 +++ b/ConfluencePS/Public/Add-Label.ps1 @@ -11,6 +11,9 @@ function Add-Label { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..cd7d73c 100644 --- a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 +++ b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 @@ -8,6 +8,9 @@ function ConvertTo-StorageFormat { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] 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..c361b8e 100644 --- a/ConfluencePS/Public/Get-Attachment.ps1 +++ b/ConfluencePS/Public/Get-Attachment.ps1 @@ -8,6 +8,9 @@ function Get-Attachment { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..8ecd778 100644 --- a/ConfluencePS/Public/Get-AttachmentFile.ps1 +++ b/ConfluencePS/Public/Get-AttachmentFile.ps1 @@ -8,6 +8,9 @@ function Get-AttachmentFile { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] @@ -59,8 +62,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..747c06f 100644 --- a/ConfluencePS/Public/Get-ChildPage.ps1 +++ b/ConfluencePS/Public/Get-ChildPage.ps1 @@ -8,6 +8,9 @@ function Get-ChildPage { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Get-Label.ps1 b/ConfluencePS/Public/Get-Label.ps1 index 06e971d..202806c 100644 --- a/ConfluencePS/Public/Get-Label.ps1 +++ b/ConfluencePS/Public/Get-Label.ps1 @@ -10,6 +10,9 @@ function Get-Label { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..20adb59 100644 --- a/ConfluencePS/Public/Get-Page.ps1 +++ b/ConfluencePS/Public/Get-Page.ps1 @@ -11,6 +11,9 @@ function Get-Page { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Get-Space.ps1 b/ConfluencePS/Public/Get-Space.ps1 index 447c395..8b83623 100644 --- a/ConfluencePS/Public/Get-Space.ps1 +++ b/ConfluencePS/Public/Get-Space.ps1 @@ -10,6 +10,9 @@ function Get-Space { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Invoke-Method.ps1 b/ConfluencePS/Public/Invoke-Method.ps1 index 4fb0447..757fe77 100644 --- a/ConfluencePS/Public/Invoke-Method.ps1 +++ b/ConfluencePS/Public/Invoke-Method.ps1 @@ -44,6 +44,9 @@ function Invoke-Method { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..9bb2425 100644 --- a/ConfluencePS/Public/New-Page.ps1 +++ b/ConfluencePS/Public/New-Page.ps1 @@ -12,6 +12,9 @@ function New-Page { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/New-Space.ps1 b/ConfluencePS/Public/New-Space.ps1 index 12af165..1e73b87 100644 --- a/ConfluencePS/Public/New-Space.ps1 +++ b/ConfluencePS/Public/New-Space.ps1 @@ -12,6 +12,9 @@ function New-Space { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Remove-Attachment.ps1 b/ConfluencePS/Public/Remove-Attachment.ps1 index 868fe70..27dcfe3 100644 --- a/ConfluencePS/Public/Remove-Attachment.ps1 +++ b/ConfluencePS/Public/Remove-Attachment.ps1 @@ -11,6 +11,9 @@ function Remove-Attachment { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..8c72a1b 100644 --- a/ConfluencePS/Public/Remove-Label.ps1 +++ b/ConfluencePS/Public/Remove-Label.ps1 @@ -11,6 +11,9 @@ function Remove-Label { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Remove-Page.ps1 b/ConfluencePS/Public/Remove-Page.ps1 index 23d20f1..16be8ab 100644 --- a/ConfluencePS/Public/Remove-Page.ps1 +++ b/ConfluencePS/Public/Remove-Page.ps1 @@ -11,6 +11,9 @@ function Remove-Page { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$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..b363b05 100644 --- a/ConfluencePS/Public/Remove-Space.ps1 +++ b/ConfluencePS/Public/Remove-Space.ps1 @@ -12,6 +12,9 @@ function Remove-Space { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Set-Attachment.ps1 b/ConfluencePS/Public/Set-Attachment.ps1 index 0b733bf..82ad121 100644 --- a/ConfluencePS/Public/Set-Attachment.ps1 +++ b/ConfluencePS/Public/Set-Attachment.ps1 @@ -11,6 +11,9 @@ function Set-Attachment { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Set-Info.ps1 b/ConfluencePS/Public/Set-Info.ps1 index f46bb38..8f13f3e 100644 --- a/ConfluencePS/Public/Set-Info.ps1 +++ b/ConfluencePS/Public/Set-Info.ps1 @@ -58,6 +58,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..00c6a14 100644 --- a/ConfluencePS/Public/Set-Label.ps1 +++ b/ConfluencePS/Public/Set-Label.ps1 @@ -11,6 +11,9 @@ function Set-Label { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] diff --git a/ConfluencePS/Public/Set-Page.ps1 b/ConfluencePS/Public/Set-Page.ps1 index 69d58a7..f3c44f4 100644 --- a/ConfluencePS/Public/Set-Page.ps1 +++ b/ConfluencePS/Public/Set-Page.ps1 @@ -12,6 +12,9 @@ function Set-Page { [Parameter( Mandatory = $false )] [PSCredential]$Credential, + [Parameter( Mandatory = $false )] + [PSCredential]$PersonalAccessToken, + [Parameter( Mandatory = $false )] [ValidateNotNull()] [System.Security.Cryptography.X509Certificates.X509Certificate] From 5a48880ebf1e1a713c51c770037b7c91983bcf1f Mon Sep 17 00:00:00 2001 From: Mathew DeGauvin Date: Mon, 3 Jan 2022 14:38:10 -0800 Subject: [PATCH 2/7] Resolving incorrect parameter type --- ConfluencePS/Public/Add-Attachment.ps1 | 3 ++- ConfluencePS/Public/Add-Label.ps1 | 3 ++- ConfluencePS/Public/ConvertTo-StorageFormat.ps1 | 3 ++- ConfluencePS/Public/Get-Attachment.ps1 | 3 ++- ConfluencePS/Public/Get-AttachmentFile.ps1 | 3 ++- ConfluencePS/Public/Get-ChildPage.ps1 | 3 ++- ConfluencePS/Public/Get-Label.ps1 | 3 ++- ConfluencePS/Public/Get-Page.ps1 | 3 ++- ConfluencePS/Public/Get-Space.ps1 | 3 ++- ConfluencePS/Public/Invoke-Method.ps1 | 3 ++- ConfluencePS/Public/New-Page.ps1 | 3 ++- ConfluencePS/Public/New-Space.ps1 | 3 ++- ConfluencePS/Public/Remove-Attachment.ps1 | 3 ++- ConfluencePS/Public/Remove-Label.ps1 | 3 ++- ConfluencePS/Public/Remove-Page.ps1 | 3 ++- ConfluencePS/Public/Remove-Space.ps1 | 3 ++- ConfluencePS/Public/Set-Attachment.ps1 | 3 ++- ConfluencePS/Public/Set-Info.ps1 | 2 ++ ConfluencePS/Public/Set-Label.ps1 | 3 ++- ConfluencePS/Public/Set-Page.ps1 | 3 ++- 20 files changed, 40 insertions(+), 19 deletions(-) diff --git a/ConfluencePS/Public/Add-Attachment.ps1 b/ConfluencePS/Public/Add-Attachment.ps1 index 6ce87d8..f080a75 100644 --- a/ConfluencePS/Public/Add-Attachment.ps1 +++ b/ConfluencePS/Public/Add-Attachment.ps1 @@ -12,7 +12,8 @@ function Add-Attachment { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Add-Label.ps1 b/ConfluencePS/Public/Add-Label.ps1 index 849877f..17d0977 100644 --- a/ConfluencePS/Public/Add-Label.ps1 +++ b/ConfluencePS/Public/Add-Label.ps1 @@ -12,7 +12,8 @@ function Add-Label { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 index cd7d73c..4db2082 100644 --- a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 +++ b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 @@ -9,7 +9,8 @@ function ConvertTo-StorageFormat { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-Attachment.ps1 b/ConfluencePS/Public/Get-Attachment.ps1 index c361b8e..2b814ea 100644 --- a/ConfluencePS/Public/Get-Attachment.ps1 +++ b/ConfluencePS/Public/Get-Attachment.ps1 @@ -9,7 +9,8 @@ function Get-Attachment { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-AttachmentFile.ps1 b/ConfluencePS/Public/Get-AttachmentFile.ps1 index 8ecd778..d7fd3ed 100644 --- a/ConfluencePS/Public/Get-AttachmentFile.ps1 +++ b/ConfluencePS/Public/Get-AttachmentFile.ps1 @@ -9,7 +9,8 @@ function Get-AttachmentFile { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-ChildPage.ps1 b/ConfluencePS/Public/Get-ChildPage.ps1 index 747c06f..d745fcc 100644 --- a/ConfluencePS/Public/Get-ChildPage.ps1 +++ b/ConfluencePS/Public/Get-ChildPage.ps1 @@ -9,7 +9,8 @@ function Get-ChildPage { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-Label.ps1 b/ConfluencePS/Public/Get-Label.ps1 index 202806c..acfd935 100644 --- a/ConfluencePS/Public/Get-Label.ps1 +++ b/ConfluencePS/Public/Get-Label.ps1 @@ -11,7 +11,8 @@ function Get-Label { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-Page.ps1 b/ConfluencePS/Public/Get-Page.ps1 index 20adb59..881a695 100644 --- a/ConfluencePS/Public/Get-Page.ps1 +++ b/ConfluencePS/Public/Get-Page.ps1 @@ -12,7 +12,8 @@ function Get-Page { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Get-Space.ps1 b/ConfluencePS/Public/Get-Space.ps1 index 8b83623..7c379f3 100644 --- a/ConfluencePS/Public/Get-Space.ps1 +++ b/ConfluencePS/Public/Get-Space.ps1 @@ -11,7 +11,8 @@ function Get-Space { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Invoke-Method.ps1 b/ConfluencePS/Public/Invoke-Method.ps1 index 757fe77..87bb68e 100644 --- a/ConfluencePS/Public/Invoke-Method.ps1 +++ b/ConfluencePS/Public/Invoke-Method.ps1 @@ -45,7 +45,8 @@ function Invoke-Method { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/New-Page.ps1 b/ConfluencePS/Public/New-Page.ps1 index 9bb2425..93f960a 100644 --- a/ConfluencePS/Public/New-Page.ps1 +++ b/ConfluencePS/Public/New-Page.ps1 @@ -13,7 +13,8 @@ function New-Page { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/New-Space.ps1 b/ConfluencePS/Public/New-Space.ps1 index 1e73b87..611009e 100644 --- a/ConfluencePS/Public/New-Space.ps1 +++ b/ConfluencePS/Public/New-Space.ps1 @@ -13,7 +13,8 @@ function New-Space { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Remove-Attachment.ps1 b/ConfluencePS/Public/Remove-Attachment.ps1 index 27dcfe3..0d321d0 100644 --- a/ConfluencePS/Public/Remove-Attachment.ps1 +++ b/ConfluencePS/Public/Remove-Attachment.ps1 @@ -12,7 +12,8 @@ function Remove-Attachment { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Remove-Label.ps1 b/ConfluencePS/Public/Remove-Label.ps1 index 8c72a1b..30eaae7 100644 --- a/ConfluencePS/Public/Remove-Label.ps1 +++ b/ConfluencePS/Public/Remove-Label.ps1 @@ -12,7 +12,8 @@ function Remove-Label { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Remove-Page.ps1 b/ConfluencePS/Public/Remove-Page.ps1 index 16be8ab..5944c82 100644 --- a/ConfluencePS/Public/Remove-Page.ps1 +++ b/ConfluencePS/Public/Remove-Page.ps1 @@ -12,7 +12,8 @@ function Remove-Page { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Remove-Space.ps1 b/ConfluencePS/Public/Remove-Space.ps1 index b363b05..23ee74e 100644 --- a/ConfluencePS/Public/Remove-Space.ps1 +++ b/ConfluencePS/Public/Remove-Space.ps1 @@ -13,7 +13,8 @@ function Remove-Space { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Set-Attachment.ps1 b/ConfluencePS/Public/Set-Attachment.ps1 index 82ad121..cc4cced 100644 --- a/ConfluencePS/Public/Set-Attachment.ps1 +++ b/ConfluencePS/Public/Set-Attachment.ps1 @@ -12,7 +12,8 @@ function Set-Attachment { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Set-Info.ps1 b/ConfluencePS/Public/Set-Info.ps1 index 8f13f3e..84f4c0c 100644 --- a/ConfluencePS/Public/Set-Info.ps1 +++ b/ConfluencePS/Public/Set-Info.ps1 @@ -9,6 +9,8 @@ function Set-Info { [PSCredential]$Credential, + [string]$PersonalAccessToken, + [UInt32]$PageSize, [switch]$PromptCredentials diff --git a/ConfluencePS/Public/Set-Label.ps1 b/ConfluencePS/Public/Set-Label.ps1 index 00c6a14..5cc5345 100644 --- a/ConfluencePS/Public/Set-Label.ps1 +++ b/ConfluencePS/Public/Set-Label.ps1 @@ -12,7 +12,8 @@ function Set-Label { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] diff --git a/ConfluencePS/Public/Set-Page.ps1 b/ConfluencePS/Public/Set-Page.ps1 index f3c44f4..8306c6e 100644 --- a/ConfluencePS/Public/Set-Page.ps1 +++ b/ConfluencePS/Public/Set-Page.ps1 @@ -13,7 +13,8 @@ function Set-Page { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [PSCredential]$PersonalAccessToken, + [string] + $PersonalAccessToken, [Parameter( Mandatory = $false )] [ValidateNotNull()] From 014bb82b8693f37f451d78e3a8a7794d29a1c7bd Mon Sep 17 00:00:00 2001 From: Mathew DeGauvin Date: Mon, 3 Jan 2022 15:11:06 -0800 Subject: [PATCH 3/7] Updating documentation --- docs/en-US/commands/Set-Info.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/en-US/commands/Set-Info.md b/docs/en-US/commands/Set-Info.md index 26559d5..12f0c6d 100644 --- a/docs/en-US/commands/Set-Info.md +++ b/docs/en-US/commands/Set-Info.md @@ -16,7 +16,7 @@ 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 ] [[-PageSize] ] [-PromptCredentials] ``` ## DESCRIPTION @@ -70,6 +70,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: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html + ## PARAMETERS ### -BaseURi @@ -105,6 +115,23 @@ 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: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + + ### -PageSize Default PageSize for the invocations. @@ -116,7 +143,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 4 Default value: 0 Accept pipeline input: False Accept wildcard characters: False From 604e253672723f309e5a99cfa26c716157d82f3f Mon Sep 17 00:00:00 2001 From: Mathew DeGauvin Date: Tue, 4 Jan 2022 08:10:04 -0800 Subject: [PATCH 4/7] Updating public function documentation --- docs/en-US/commands/Add-Attachment.md | 17 +++++++++++++++++ docs/en-US/commands/Add-Label.md | 17 +++++++++++++++++ docs/en-US/commands/ConvertTo-StorageFormat.md | 17 +++++++++++++++++ docs/en-US/commands/Get-Attachment.md | 17 +++++++++++++++++ docs/en-US/commands/Get-AttachmentFile.md | 17 +++++++++++++++++ docs/en-US/commands/Get-ChildPage.md | 17 +++++++++++++++++ docs/en-US/commands/Get-Label.md | 17 +++++++++++++++++ docs/en-US/commands/Get-Page.md | 17 +++++++++++++++++ docs/en-US/commands/Get-Space.md | 17 +++++++++++++++++ docs/en-US/commands/New-Page.md | 17 +++++++++++++++++ docs/en-US/commands/New-Space.md | 17 +++++++++++++++++ docs/en-US/commands/Remove-Attachment.md | 17 +++++++++++++++++ docs/en-US/commands/Remove-Label.md | 17 +++++++++++++++++ docs/en-US/commands/Remove-Page.md | 17 +++++++++++++++++ docs/en-US/commands/Remove-Space.md | 17 +++++++++++++++++ docs/en-US/commands/Set-Attachment.md | 17 +++++++++++++++++ docs/en-US/commands/Set-Label.md | 17 +++++++++++++++++ docs/en-US/commands/Set-Page.md | 17 +++++++++++++++++ 18 files changed, 306 insertions(+) diff --git a/docs/en-US/commands/Add-Attachment.md b/docs/en-US/commands/Add-Attachment.md index b32594f..456b2d9 100644 --- a/docs/en-US/commands/Add-Attachment.md +++ b/docs/en-US/commands/Add-Attachment.md @@ -82,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/Add-Label.md b/docs/en-US/commands/Add-Label.md index 4c04829..6caf7bd 100644 --- a/docs/en-US/commands/Add-Label.md +++ b/docs/en-US/commands/Add-Label.md @@ -91,6 +91,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..ffcbd79 100644 --- a/docs/en-US/commands/ConvertTo-StorageFormat.md +++ b/docs/en-US/commands/ConvertTo-StorageFormat.md @@ -79,6 +79,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..46eef62 100644 --- a/docs/en-US/commands/Get-Attachment.md +++ b/docs/en-US/commands/Get-Attachment.md @@ -97,6 +97,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..999a09e 100644 --- a/docs/en-US/commands/Get-AttachmentFile.md +++ b/docs/en-US/commands/Get-AttachmentFile.md @@ -82,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-ChildPage.md b/docs/en-US/commands/Get-ChildPage.md index 5f47b81..a8e65b8 100644 --- a/docs/en-US/commands/Get-ChildPage.md +++ b/docs/en-US/commands/Get-ChildPage.md @@ -83,6 +83,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..3c5c878 100644 --- a/docs/en-US/commands/Get-Label.md +++ b/docs/en-US/commands/Get-Label.md @@ -80,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-Page.md b/docs/en-US/commands/Get-Page.md index 0465c21..b70e2c3 100644 --- a/docs/en-US/commands/Get-Page.md +++ b/docs/en-US/commands/Get-Page.md @@ -141,6 +141,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..2625bef 100644 --- a/docs/en-US/commands/Get-Space.md +++ b/docs/en-US/commands/Get-Space.md @@ -90,6 +90,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-Page.md b/docs/en-US/commands/New-Page.md index 6b103c2..c617347 100644 --- a/docs/en-US/commands/New-Page.md +++ b/docs/en-US/commands/New-Page.md @@ -138,6 +138,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..7511e3b 100644 --- a/docs/en-US/commands/New-Space.md +++ b/docs/en-US/commands/New-Space.md @@ -99,6 +99,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..3266692 100644 --- a/docs/en-US/commands/Remove-Attachment.md +++ b/docs/en-US/commands/Remove-Attachment.md @@ -91,6 +91,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..0df0fa9 100644 --- a/docs/en-US/commands/Remove-Label.md +++ b/docs/en-US/commands/Remove-Label.md @@ -91,6 +91,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..83e0514 100644 --- a/docs/en-US/commands/Remove-Page.md +++ b/docs/en-US/commands/Remove-Page.md @@ -91,6 +91,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..303869c 100644 --- a/docs/en-US/commands/Remove-Space.md +++ b/docs/en-US/commands/Remove-Space.md @@ -83,6 +83,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..0a7ea54 100644 --- a/docs/en-US/commands/Set-Attachment.md +++ b/docs/en-US/commands/Set-Attachment.md @@ -79,6 +79,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-Label.md b/docs/en-US/commands/Set-Label.md index 90b2fb2..97c258a 100644 --- a/docs/en-US/commands/Set-Label.md +++ b/docs/en-US/commands/Set-Label.md @@ -82,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/Set-Page.md b/docs/en-US/commands/Set-Page.md index e828f81..4867e5c 100644 --- a/docs/en-US/commands/Set-Page.md +++ b/docs/en-US/commands/Set-Page.md @@ -111,6 +111,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. From 7e56561b4e202a35fe869526aab2b173a2961207 Mon Sep 17 00:00:00 2001 From: Mathew DeGauvin Date: Tue, 4 Jan 2022 08:17:36 -0800 Subject: [PATCH 5/7] Fixing line19 parameter type to --- docs/en-US/commands/Set-Info.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en-US/commands/Set-Info.md b/docs/en-US/commands/Set-Info.md index 12f0c6d..a362601 100644 --- a/docs/en-US/commands/Set-Info.md +++ b/docs/en-US/commands/Set-Info.md @@ -16,7 +16,7 @@ Specify wiki location and authorization for use in this session's REST API reque ## SYNTAX ```powershell -Set-ConfluenceInfo [[-BaseURi] ] [[-Credential] ] [-PersonalAccessToken ] [[-PageSize] ] [-PromptCredentials] +Set-ConfluenceInfo [[-BaseURi] ] [[-Credential] ] [-PersonalAccessToken ] [[-PageSize] ] [-PromptCredentials] ``` ## DESCRIPTION From 2e527a59c7d4935425ecddc5b128412f179673f7 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Wed, 5 Jan 2022 11:41:35 +0100 Subject: [PATCH 6/7] Updated documentation on private cmdlets --- Tests/Build.Tests.ps1 | 2 +- docs/en-US/commands/Invoke-Method.md | 37 ++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 11 deletions(-) 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/Invoke-Method.md b/docs/en-US/commands/Invoke-Method.md index 75adf56..57f8d66 100644 --- a/docs/en-US/commands/Invoke-Method.md +++ b/docs/en-US/commands/Invoke-Method.md @@ -18,8 +18,9 @@ Invoke a specific call to a Confluence REST Api endpoint ```powershell Invoke-ConfluenceMethod [-URi] [[-Method] ] [[-Body] ] [-RawBody] - [[-Headers] ] [[-GetParameters] ] [[-InFile] ] [[-OutFile] ] - [[-OutputType] ] [-Credential] [[-Caller] ] [-IncludeTotalCount] [-Skip ] + [-Headers ] [-GetParameters ] [-InFile ] [-OutFile ] + [-OutputType ] [-Credential ] [-PersonalAccessToken ] + [-Certificate ] [-Caller ] [-IncludeTotalCount] [-Skip ] [-First ] [] ``` @@ -224,7 +225,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -244,7 +245,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -262,7 +263,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -280,7 +281,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -299,7 +300,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -317,7 +318,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 +352,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 10 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -351,7 +368,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 11 +Position: Named Default value: $PSCmdlet Accept pipeline input: False Accept wildcard characters: False From 78cac875ab852f7d95cf9bff22f71fa060623eee Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Sun, 9 Jan 2022 10:26:50 +0100 Subject: [PATCH 7/7] Updated syntax of public functions --- ConfluencePS/Public/Add-Attachment.ps1 | 10 +++++--- ConfluencePS/Public/Add-Label.ps1 | 4 +-- .../Public/ConvertTo-StorageFormat.ps1 | 6 ++--- ConfluencePS/Public/Get-Attachment.ps1 | 4 +-- ConfluencePS/Public/Get-AttachmentFile.ps1 | 4 +-- ConfluencePS/Public/Get-ChildPage.ps1 | 8 +++--- ConfluencePS/Public/Get-Label.ps1 | 4 +-- ConfluencePS/Public/Get-Page.ps1 | 14 +++++------ ConfluencePS/Public/Get-Space.ps1 | 6 ++--- ConfluencePS/Public/Invoke-Method.ps1 | 9 ++++--- ConfluencePS/Public/New-Page.ps1 | 14 ++++++----- ConfluencePS/Public/New-Space.ps1 | 10 ++++---- ConfluencePS/Public/Remove-Attachment.ps1 | 4 +-- ConfluencePS/Public/Remove-Label.ps1 | 6 ++--- ConfluencePS/Public/Remove-Page.ps1 | 4 +-- ConfluencePS/Public/Remove-Space.ps1 | 8 +++--- ConfluencePS/Public/Set-Attachment.ps1 | 6 ++--- ConfluencePS/Public/Set-Info.ps1 | 10 ++++---- ConfluencePS/Public/Set-Label.ps1 | 8 +++--- ConfluencePS/Public/Set-Page.ps1 | 10 ++++---- docs/en-US/commands/Add-Attachment.md | 4 ++- docs/en-US/commands/Add-Label.md | 4 ++- .../en-US/commands/ConvertTo-StorageFormat.md | 3 ++- docs/en-US/commands/Get-Attachment.md | 5 +++- docs/en-US/commands/Get-AttachmentFile.md | 4 ++- docs/en-US/commands/Get-ChildPage.md | 5 +++- docs/en-US/commands/Get-Label.md | 6 +++-- docs/en-US/commands/Get-Page.md | 25 +++++++++++++++---- docs/en-US/commands/Get-Space.md | 5 +++- docs/en-US/commands/Invoke-Method.md | 11 ++++---- docs/en-US/commands/New-Page.md | 9 +++++-- docs/en-US/commands/New-Space.md | 9 ++++--- docs/en-US/commands/Remove-Attachment.md | 4 ++- docs/en-US/commands/Remove-Label.md | 4 ++- docs/en-US/commands/Remove-Page.md | 4 ++- docs/en-US/commands/Remove-Space.md | 4 ++- docs/en-US/commands/Set-Attachment.md | 4 ++- docs/en-US/commands/Set-Info.md | 15 +++++------ docs/en-US/commands/Set-Label.md | 4 ++- docs/en-US/commands/Set-Page.md | 9 +++++-- 40 files changed, 178 insertions(+), 109 deletions(-) diff --git a/ConfluencePS/Public/Add-Attachment.ps1 b/ConfluencePS/Public/Add-Attachment.ps1 index f080a75..5659e30 100644 --- a/ConfluencePS/Public/Add-Attachment.ps1 +++ b/ConfluencePS/Public/Add-Attachment.ps1 @@ -6,13 +6,13 @@ function Add-Attachment { [OutputType([ConfluencePS.Attachment])] param( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -30,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 17d0977..2bf26e6 100644 --- a/ConfluencePS/Public/Add-Label.ps1 +++ b/ConfluencePS/Public/Add-Label.ps1 @@ -6,13 +6,13 @@ function Add-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 index 4db2082..d09969c 100644 --- a/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 +++ b/ConfluencePS/Public/ConvertTo-StorageFormat.ps1 @@ -3,13 +3,13 @@ function ConvertTo-StorageFormat { [OutputType([String])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -22,7 +22,7 @@ function ConvertTo-StorageFormat { Mandatory = $true, ValueFromPipeline = $true )] - [string[]]$Content + [String[]]$Content ) BEGIN { diff --git a/ConfluencePS/Public/Get-Attachment.ps1 b/ConfluencePS/Public/Get-Attachment.ps1 index 2b814ea..39e3571 100644 --- a/ConfluencePS/Public/Get-Attachment.ps1 +++ b/ConfluencePS/Public/Get-Attachment.ps1 @@ -3,13 +3,13 @@ function Get-Attachment { [OutputType([ConfluencePS.Attachment])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/Get-AttachmentFile.ps1 b/ConfluencePS/Public/Get-AttachmentFile.ps1 index d7fd3ed..b80672f 100644 --- a/ConfluencePS/Public/Get-AttachmentFile.ps1 +++ b/ConfluencePS/Public/Get-AttachmentFile.ps1 @@ -3,13 +3,13 @@ function Get-AttachmentFile { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/Get-ChildPage.ps1 b/ConfluencePS/Public/Get-ChildPage.ps1 index d745fcc..6fe9f84 100644 --- a/ConfluencePS/Public/Get-ChildPage.ps1 +++ b/ConfluencePS/Public/Get-ChildPage.ps1 @@ -3,13 +3,13 @@ function Get-ChildPage { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -27,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 acfd935..e07aa80 100644 --- a/ConfluencePS/Public/Get-Label.ps1 +++ b/ConfluencePS/Public/Get-Label.ps1 @@ -5,13 +5,13 @@ function Get-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/Get-Page.ps1 b/ConfluencePS/Public/Get-Page.ps1 index 881a695..a677a94 100644 --- a/ConfluencePS/Public/Get-Page.ps1 +++ b/ConfluencePS/Public/Get-Page.ps1 @@ -6,13 +6,13 @@ function Get-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -38,7 +38,7 @@ function Get-Page { ParameterSetName = "bySpaceObject" )] [Alias('Name')] - [string]$Title, + [String]$Title, [Parameter( Mandatory = $true, @@ -48,7 +48,7 @@ function Get-Page { ParameterSetName = "byLabel" )] [Alias('Key')] - [string]$SpaceKey, + [String]$SpaceKey, [Parameter( Mandatory = $true, @@ -66,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 7c379f3..505f989 100644 --- a/ConfluencePS/Public/Get-Space.ps1 +++ b/ConfluencePS/Public/Get-Space.ps1 @@ -5,13 +5,13 @@ function Get-Space { [OutputType([ConfluencePS.Space])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -23,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 87bb68e..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", @@ -45,7 +48,7 @@ function Invoke-Method { [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/New-Page.ps1 b/ConfluencePS/Public/New-Page.ps1 index 93f960a..6329637 100644 --- a/ConfluencePS/Public/New-Page.ps1 +++ b/ConfluencePS/Public/New-Page.ps1 @@ -7,13 +7,13 @@ function New-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -34,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 611009e..4308792 100644 --- a/ConfluencePS/Public/New-Space.ps1 +++ b/ConfluencePS/Public/New-Space.ps1 @@ -7,13 +7,13 @@ function New-Space { [OutputType([ConfluencePS.Space])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -33,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 0d321d0..9a715dc 100644 --- a/ConfluencePS/Public/Remove-Attachment.ps1 +++ b/ConfluencePS/Public/Remove-Attachment.ps1 @@ -6,13 +6,13 @@ function Remove-Attachment { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/Remove-Label.ps1 b/ConfluencePS/Public/Remove-Label.ps1 index 30eaae7..ab7639b 100644 --- a/ConfluencePS/Public/Remove-Label.ps1 +++ b/ConfluencePS/Public/Remove-Label.ps1 @@ -6,13 +6,13 @@ function Remove-Label { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -31,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 5944c82..73135d6 100644 --- a/ConfluencePS/Public/Remove-Page.ps1 +++ b/ConfluencePS/Public/Remove-Page.ps1 @@ -6,13 +6,13 @@ function Remove-Page { [OutputType([Bool])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] diff --git a/ConfluencePS/Public/Remove-Space.ps1 b/ConfluencePS/Public/Remove-Space.ps1 index 23ee74e..75330c2 100644 --- a/ConfluencePS/Public/Remove-Space.ps1 +++ b/ConfluencePS/Public/Remove-Space.ps1 @@ -7,13 +7,13 @@ 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] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -28,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 cc4cced..ab4ab32 100644 --- a/ConfluencePS/Public/Set-Attachment.ps1 +++ b/ConfluencePS/Public/Set-Attachment.ps1 @@ -6,13 +6,13 @@ function Set-Attachment { [OutputType([ConfluencePS.Attachment])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -28,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 84f4c0c..e8e8eff 100644 --- a/ConfluencePS/Public/Set-Info.ps1 +++ b/ConfluencePS/Public/Set-Info.ps1 @@ -5,15 +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, + [String]$PersonalAccessToken, [UInt32]$PageSize, - [switch]$PromptCredentials + [Switch]$PromptCredentials ) BEGIN { @@ -21,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 diff --git a/ConfluencePS/Public/Set-Label.ps1 b/ConfluencePS/Public/Set-Label.ps1 index 5cc5345..8c59e39 100644 --- a/ConfluencePS/Public/Set-Label.ps1 +++ b/ConfluencePS/Public/Set-Label.ps1 @@ -6,13 +6,13 @@ function Set-Label { [OutputType([ConfluencePS.ContentLabelSet])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -30,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 8306c6e..4516c64 100644 --- a/ConfluencePS/Public/Set-Page.ps1 +++ b/ConfluencePS/Public/Set-Page.ps1 @@ -7,13 +7,13 @@ function Set-Page { [OutputType([ConfluencePS.Page])] param ( [Parameter( Mandatory = $true )] - [uri]$ApiUri, + [Uri]$ApiUri, [Parameter( Mandatory = $false )] [PSCredential]$Credential, [Parameter( Mandatory = $false )] - [string] + [String] $PersonalAccessToken, [Parameter( Mandatory = $false )] @@ -39,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/docs/en-US/commands/Add-Attachment.md b/docs/en-US/commands/Add-Attachment.md index 456b2d9..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 diff --git a/docs/en-US/commands/Add-Label.md b/docs/en-US/commands/Add-Label.md index 6caf7bd..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 diff --git a/docs/en-US/commands/ConvertTo-StorageFormat.md b/docs/en-US/commands/ConvertTo-StorageFormat.md index ffcbd79..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 diff --git a/docs/en-US/commands/Get-Attachment.md b/docs/en-US/commands/Get-Attachment.md index 46eef62..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 diff --git a/docs/en-US/commands/Get-AttachmentFile.md b/docs/en-US/commands/Get-AttachmentFile.md index 999a09e..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 diff --git a/docs/en-US/commands/Get-ChildPage.md b/docs/en-US/commands/Get-ChildPage.md index a8e65b8..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 diff --git a/docs/en-US/commands/Get-Label.md b/docs/en-US/commands/Get-Label.md index 3c5c878..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 diff --git a/docs/en-US/commands/Get-Page.md b/docs/en-US/commands/Get-Page.md index b70e2c3..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 diff --git a/docs/en-US/commands/Get-Space.md b/docs/en-US/commands/Get-Space.md index 2625bef..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 diff --git a/docs/en-US/commands/Invoke-Method.md b/docs/en-US/commands/Invoke-Method.md index 57f8d66..e1930bd 100644 --- a/docs/en-US/commands/Invoke-Method.md +++ b/docs/en-US/commands/Invoke-Method.md @@ -17,11 +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 ] [-PersonalAccessToken ] - [-Certificate ] [-Caller ] [-IncludeTotalCount] [-Skip ] - [-First ] [] +Invoke-ConfluenceMethod [-URi] [-Method ] [-Body ] + [-RawBody] [-Headers ] [-GetParameters ] [-InFile ] + [-OutFile ] [-OutputType ] [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-Caller ] [-IncludeTotalCount] [-Skip ] [-First ] + [] ``` ## DESCRIPTION diff --git a/docs/en-US/commands/New-Page.md b/docs/en-US/commands/New-Page.md index c617347..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 diff --git a/docs/en-US/commands/New-Space.md b/docs/en-US/commands/New-Space.md index 7511e3b..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 diff --git a/docs/en-US/commands/Remove-Attachment.md b/docs/en-US/commands/Remove-Attachment.md index 3266692..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 diff --git a/docs/en-US/commands/Remove-Label.md b/docs/en-US/commands/Remove-Label.md index 0df0fa9..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 diff --git a/docs/en-US/commands/Remove-Page.md b/docs/en-US/commands/Remove-Page.md index 83e0514..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 diff --git a/docs/en-US/commands/Remove-Space.md b/docs/en-US/commands/Remove-Space.md index 303869c..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 diff --git a/docs/en-US/commands/Set-Attachment.md b/docs/en-US/commands/Set-Attachment.md index 0a7ea54..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 diff --git a/docs/en-US/commands/Set-Info.md b/docs/en-US/commands/Set-Info.md index a362601..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] ] [-PersonalAccessToken ] [[-PageSize] ] [-PromptCredentials] +Set-ConfluenceInfo [-BaseURi ] [-Credential ] + [-PersonalAccessToken ] [-Certificate ] + [-PageSize ] [-PromptCredentials] ``` ## DESCRIPTION @@ -78,7 +80,7 @@ Set-ConfluenceInfo -BaseURI 'https://wiki.yourcompany.com' -PersonalAccessToken ``` Declare the URI of your Confluence instance and the Personal Access Token. -See: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html +See: ## PARAMETERS @@ -93,7 +95,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -109,7 +111,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -125,13 +127,12 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` - ### -PageSize Default PageSize for the invocations. @@ -143,7 +144,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +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 97c258a..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 diff --git a/docs/en-US/commands/Set-Page.md b/docs/en-US/commands/Set-Page.md index 4867e5c..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