chocolatey-licensed-issues
chocolatey-licensed-issues copied to clipboard
Package Internalizer - Fails when detecting URL being output as a string from Write-Verbose command
What You Are Seeing?
When running package internalizer on a package where the URL that is to be internalized is being output by Write-Verbose
within the install.ps1 powershell file of the package due to it being passed as a string. Package internalizer is unable to interpret this and fails resolving the URL it creates from this output.
What is Expected?
When a URL in a package is defined using Write-Verbose
or any other powershell command that outputs as a string format. Package internalizer should be able process this to construct a workable URL from the command in the package.
How Did You Get This To Happen? (Steps to Reproduce)
Run the following command:
choco.exe download pdfxchangepro --force --internalize --source="'https://chocolatey.org/api/v2/;'" lastModified="'2021/06/17'"
Output Log
Found internalizable Chocolatey functions. Inspecting values for remote resources.
Overriding $version variable with user-provided value '9.0.354.0'
Found 'https://downloads.pdf-xchange.com/ProV9.x86.msi' for replacement.
Found 'https://downloads.pdf-xchange.com/ProV9.x64.msi' for replacement.
Found 'http://www.docu-track.co.uk/builds/9.0.354.0/ProV9.x86.msi' for replacement.
Found 'http://www.docu-track.co.uk/builds/9.0.354.0/ProV9.x64.msi' for replacement.
Found 'HTTP Last Modified : 2021/06/17' for replacement.
Encountered error downloading package pdfxchangepro v:
System.UriFormatException: Invalid URI: The URI scheme is not valid.
References
- ZenDesk Ticket
- GitLab link to line in internalizer code base where this is happening.
┆Issue is synchronized with this GitLab issue by Unito