Skip to content

Commit

Permalink
Merge pull request AtlassianPS#182 from FreZZZeR/DocsFix
Browse files Browse the repository at this point in the history
Docs fix
  • Loading branch information
lipkau authored May 20, 2020
2 parents adb0628 + 5aa9234 commit 2aa759a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
10 changes: 10 additions & 0 deletions ConfluencePS/Private/Invoke-WebRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function Invoke-WebRequest {
"",
Justification = "Converting received plaintext token to SecureString"
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
"PSAvoidOverwritingBuiltInCmdlets",
"",
Justification = "Function for internal use"
)]
param(
[switch]
${UseBasicParsing},
Expand Down Expand Up @@ -161,6 +166,11 @@ if ($PSVersionTable.PSVersion.Major -ge 6) {
function Invoke-WebRequest {
#require -Version 6
[CmdletBinding(DefaultParameterSetName = 'StandardMethod', HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=217035')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
"PSAvoidOverwritingBuiltInCmdlets",
"",
Justification = "Function for internal use"
)]
param(
[switch]
${UseBasicParsing},
Expand Down
18 changes: 12 additions & 6 deletions ConfluencePS/Private/Set-TlsLevel.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
function Set-TlsLevel {
[CmdletBinding( SupportsShouldProcess = $false )]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')]
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"PSUseShouldProcessForStateChangingFunctions",
"",
Justification = "The function sets the state of the security protocol for using TLS1.2 and restores it to its original state.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"PSReviewUnusedParameter",
"",
Justification = "Unused parameters are used through ParameterSetName.")]
param (
[Parameter(Mandatory, ParameterSetName = 'Set')]
[Parameter(Mandatory = $true, ParameterSetName = 'Set')]
[Switch]$Tls12,

[Parameter(Mandatory, ParameterSetName = 'Revert')]
[Parameter(Mandatory = $true, ParameterSetName = 'Revert')]
[Switch]$Revert
)

begin {
switch ($PSCmdlet.ParameterSetName) {
"Set" {
'Set' {
$Script:OriginalTlsSettings = [Net.ServicePointManager]::SecurityProtocol

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
}
"Revert" {
'Revert' {
if ($Script:OriginalTlsSettings) {
[Net.ServicePointManager]::SecurityProtocol = $Script:OriginalTlsSettings
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Help.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Describe "Help tests" -Tag Documentation {
)

$module = Get-Module $env:BHProjectName
$commands = Get-Command -Module $module -CommandType Cmdlet, Function, Workflow # Not alias
$commands = Get-Command -Module $module -CommandType Cmdlet, Function # Not alias
# $classes = Get-ChildItem "$env:BHProjectPath/docs/en-US/classes/*"
# $enums = Get-ChildItem "$env:BHProjectPath/docs/en-US/enumerations/*"

Expand Down
6 changes: 3 additions & 3 deletions docs/en-US/commands/Set-Attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Updates an existing attachment with a new file.
## SYNTAX

```powershell
Set-Attachment -ApiUri <Uri> -Credential <PSCredential> [-Attachment] <Attachment> -FilePath <String> [-WhatIf] [-Confirm]
Set-ConfluenceAttachment -ApiUri <Uri> -Credential <PSCredential> [-Attachment] <Attachment> -FilePath <String> [-WhatIf] [-Confirm]
```

## DESCRIPTION
Expand All @@ -29,15 +29,15 @@ Updates an existing attachment with a new file.

```powershell
$attachment = Get-ConfluenceAttachment -PageID 123456 -FileNameFilter test.png
Set-ConfluenceAttachment -Attachment $attachment -FileName newTest.png -Verbose -Confirm
Set-ConfluenceAttachment -Attachment $attachment -FilePath newTest.png -Verbose -Confirm
```

For the attachment test.png on page with ID 123456, replace the file with the file newTest.png.

### -------------------------- EXAMPLE 2 --------------------------

```powershell
Get-ConfluenceAttachment -PageID 123456 -FileNameFilter test.png | Set-Attachment -FileName newTest.png -WhatIf
Get-ConfluenceAttachment -PageID 123456 -FileNameFilter test.png | Set-ConfluenceAttachment -FilePath newTest.png -WhatIf
```

Would replace the attachment test.png to the page with ID 123456.
Expand Down

0 comments on commit 2aa759a

Please sign in to comment.