Qlik-Cli-Windows icon indicating copy to clipboard operation
Qlik-Cli-Windows copied to clipboard

Invoke-WebRequest error while exporting the apps

Open venku2208 opened this issue 1 year ago • 2 comments

Hi @ahaydon,

i am trying to export the apps using following code

Get-PfxCertificate -FilePath C:\Certificates\CLI\client.pfx | Connect-Qlik -ComputerName siiplqlikdev -Username siiplqlikdev\qlikservice -TrustAllCerts $myserver = "siiplqlikdev" $folder = "c:\Qlik Backup" Connect-Qlik $myserver ## check https://github.com/ahaydon/Qlik-Cli for details foreach($qvf in $(get-qlikapp)) { if ($qvf.published -and $qvf.stream.name) { # Is it published? $streamfolder = $qvf.stream.name If(!(test-path "$folder$streamfolder")) # Create a folder if it does not exists { New-Item -ItemType Directory -Force -Path "$folder$streamfolder" } } else { $streamfolder = "" } Export-QlikApp -id $qvf.id -filename "$($folder)$($streamfolder)$($qvf.name).qvf" #dumps the qvf }

but i am getting following error at the export

Invoke-WebRequest : Content-Length or Chunked Encoding cannot be set for an operation that does not write data. At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1:60 char:23 $result = Invoke-WebRequest @paramInvokeRestMethod @params -UseBasic ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ProtocolViolationException FullyQualifiedErrorId : System.Net.ProtocolViolationException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Thanks in advance

venku2208 avatar Oct 20 '23 05:10 venku2208

It seems it is caused by this commit: https://github.com/ahaydon/Qlik-Cli-Windows/commit/4e91750b213d523817ef987118c0bf1f9f1ebbea#diff-02c3a6f2e0c2360ed3df742a4b8788ce2410235316b35081299fe4128f6ae3bfR56

janci007 avatar Oct 27 '23 11:10 janci007

It seems it is caused by this commit: 4e91750#diff-02c3a6f2e0c2360ed3df742a4b8788ce2410235316b35081299fe4128f6ae3bfR56

This looks like the culprit, though that commit is only in the beta release so it should be working in the v1.22.0 release. The next release is long overdue anyway so I'll push a fix and a new release.

ahaydon avatar Nov 01 '23 10:11 ahaydon