Hi Team,
We have developed a powershell script to download the Packages from the Octopus Server and use the package data internally. The issue we are facing now is running the script as part of a runbook in octopus deploy is taking more time. Infact if I run this script directly on Powershell ISE it takes approximately[2 to 3 minutes]. But from Octopus Deploy it takes [6 to 7 Minutes]. The more the data Octopus Deploy Takes more time to execute the same script. and there is no latency as both via octopus Deploy[Powershell] and using Powershell ISE we are running in the same server.
Powershell Command where we are downloading the package:
Invoke-WebRequest -Uri “$OctoURL/api/$Spaces_Name/packages/packages-$packagename.$PackageVersion/raw?apikey=$API_Key” -OutFile “$ExtractTokenLocalPath\$GetName\$GetVersion\$Name\$package.$PackageVersion.zip”
Please let me know if there is any alternative method to download the packages faster. Please note we are trying to achieve this only via API and not via Octo.exe.