Help request!

This topic contains 4 replies, has 3 voices, and was last updated by  postanote 6 months, 3 weeks ago.

  • Author
  • #83342

    mridul das

    Hello All,

    I am new to powershell sripting, required little help solving a requirement, Can anyone help me with a powershell script in getting the latest build artifact from bamboo server & download the same?

    Thanks a lot!

  • #83362

    mridul das

    Can anyone guide me with the below error,

    Curl : Chunked encoding must be set via the SendChunked property.
    Parameter name: value
    At C:\test.ps1:12 char:1
    + Curl -Uri $artifacts -WebSession $TeamCitySession -TransferEncoding "chunked" -O ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

    How to set the sendChunked property ??

  • #83366

    Jeremy Murrah

    Can't say what that could be related to, but in powershell the "curl" command is actually an alias for "Invoke-WebRequest". So you can run this to get the documentation for that command. There might be something in there that helps you out.

    get-help Invoke-WebRequest
  • #83374

    mridul das

    Thanks Jeremy for your kind response.

    I was getting outofmemory error while downloading a big artifact file(3GB) from bamboo.I am trying to resolve the outofmemory

    Invoke-WebRequest : Exception of type 'System.OutOfMemoryException' was thrown.
    At C:\test.ps1:7 char:1
    + Invoke-WebRequest -Uri $artifacts -WebSession $TeamCitySession -OutFile "C:\tem ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], OutOfMemoryException
    + FullyQualifiedErrorId : System.OutOfMemoryException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

    tried setting powershell memory to higher value set-item wsman:localhost\shell\maxmemorypershellmb 1000000 . however, it is not helping me.

    Can you or anyone in the forum can suggest me any workaround to it. It will make life easy, help much appreciated.

  • #83422


    You want to ensure that you are using the right tool for the right job.

    For example, see these to references:

You must be logged in to reply to this topic.