diff --git a/ConfluencePS.build.ps1 b/ConfluencePS.build.ps1 index 938f7f0..f5ca617 100644 --- a/ConfluencePS.build.ps1 +++ b/ConfluencePS.build.ps1 @@ -192,7 +192,7 @@ task Deploy -If ( (-not ($env:APPVEYOR_PULL_REQUEST_NUMBER)) -and # Do not deploy if the commit contains the string "skip-deploy" # Meant for major/minor version publishes with a .0 build/patch version (like 2.1.0) - $env:APPVEYOR_REPO_COMMIT_MESSAGE -notlike '*skip-deploy*' + $env:APPVEYOR_REPO_COMMIT_MESSAGE -notlike '*skip-deploy*' -and ) { Remove-Module ConfluencePS -ErrorAction SilentlyContinue }, PublishToGallery diff --git a/ConfluencePS/ConfluencePS.psm1 b/ConfluencePS/ConfluencePS.psm1 index 61fe041..1b5ef68 100644 --- a/ConfluencePS/ConfluencePS.psm1 +++ b/ConfluencePS/ConfluencePS.psm1 @@ -1,10 +1,3 @@ -try { - Add-Type -AssemblyName System.Core -} -catch { - Write-Host "FFFF" -} - # Load the ConfluencePS namespace from C# if (!("ConfluencePS.Space" -as [Type])) { Add-Type -Path (Join-Path $PSScriptRoot ConfluencePS.Types.cs) -ReferencedAssemblies Microsoft.CSharp diff --git a/ConfluencePS/Private/Invoke-Method.ps1 b/ConfluencePS/Private/Invoke-Method.ps1 index 60a4d22..125816c 100644 --- a/ConfluencePS/Private/Invoke-Method.ps1 +++ b/ConfluencePS/Private/Invoke-Method.ps1 @@ -71,9 +71,8 @@ function Invoke-Method { # pass input to local variable # this allows to use the PSBoundParameters for recursion $_headers = @{ # Set any default headers - # "Accept" = "application/json" - # "Accept-Charset" = "utf-8" - "Content-Type" = "application/json; charset=utf-8" + "Accept" = "application/json" + "Accept-Charset" = "utf-8" } $Headers.Keys.foreach( { $_headers[$_] = $Headers[$_] }) } @@ -102,18 +101,18 @@ function Invoke-Method { Uri = $URi Method = $Method Headers = $_headers - # ContentType = "application/json; charset=utf-8" + ContentType = "application/json; charset=utf-8" UseBasicParsing = $true Credential = $Credential ErrorAction = "Stop" - # Verbose = $false # Overwrites verbose output + Verbose = $false # Overwrites verbose output } - # if ($_headers.ContainsKey("Content-Type")) { - # $splatParameters["ContentType"] = $_headers["Content-Type"] - # $_headers.Remove("Content-Type") - # $splatParameters["Headers"] = $_headers - # } + if ($_headers.ContainsKey("Content-Type")) { + $splatParameters["ContentType"] = $_headers["Content-Type"] + $_headers.Remove("Content-Type") + $splatParameters["Headers"] = $_headers + } if ($Body) { if ($RawBody) { @@ -138,17 +137,11 @@ function Invoke-Method { # This shall be fixed with PoSh v6: /~https://github.com/PowerShell/PowerShell/issues/2193 Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server" $webResponse = $_ - Write-Verbose ($webResponse) - Write-Verbose ($webResponse | Out-String) - Write-Verbose ($webResponse | gm | Out-String) - Write-Verbose ($webResponse.gettype()) if ($webResponse.ErrorDetails) { - Write-Verbose "1" # In PowerShellCore (v6+), the response body is available as string $responseBody = $webResponse.ErrorDetails.Message } else { - Write-Verbose "2" $webResponse = $webResponse.Exception.Response } } diff --git a/Tests/ConfluencePS.Integration.Tests.ps1 b/Tests/ConfluencePS.Integration.Tests.ps1 index 4f4461b..191121b 100644 --- a/Tests/ConfluencePS.Integration.Tests.ps1 +++ b/Tests/ConfluencePS.Integration.Tests.ps1 @@ -81,11 +81,11 @@ InModuleScope ConfluencePS { } # $Space3 # Ensure the space doesn't already exist - Get-ConfluenceSpace -Key $Key1 -ErrorAction SilentlyContinue -Verbose #TODO + Get-ConfluenceSpace -Key $Key1 -ErrorAction SilentlyContinue #TODO # ACT - $NewSpace1 = $Space1 | New-ConfluenceSpace -ErrorAction Stop -Verbose - $NewSpace2 = New-ConfluenceSpace -Key $Key2 -Name $Name2 -Description $Description -ErrorAction Stop -Verbose + $NewSpace1 = $Space1 | New-ConfluenceSpace -ErrorAction Stop + $NewSpace2 = New-ConfluenceSpace -Key $Key2 -Name $Name2 -Description $Description -ErrorAction Stop # ASSERT It 'returns an object with specific properties' { diff --git a/appveyor.yml b/appveyor.yml index f6c0664..80c6256 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,11 +30,10 @@ skip_commits: files: - .github/ - .vscode/ - - assets/ - - Tools/ - README.md - .gitattributes - .gitignore + - .env* # PRs, by definition, don't change anything and therefore should not increment the version # To be fair, this is not important, and is really just AppVeyor enabling my pedantry @@ -80,5 +79,5 @@ deploy: branch: master # release from master branch only appveyor_repo_tag: false # deploy on tag push only -on_failure: - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +# on_failure: + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))