I'm working on a NuGet package that will store my common build/release scripts for reuse, as suggested here:
https://stackoverflow.com/a/52443814
As such, the package's contents should be extracted when it's installed (or overwritten when it's updated), so that the scripts can be pushed to the server as part of the containing project's repo, to be consumed in turn by that project's pipeline. Old news: execution of Install.ps1
and Uninstall.ps1
scripts are deprecated, so that's not an option.
I built a simple test package from this NuSpec file:
<?xml version="1.0"?><package ><metadata><id>PipelineScripts</id><version>$version$</version><title>PipelineScripts</title><authors>InteXX</authors><owners>InteXX</owners><requireLicenseAcceptance>false</requireLicenseAcceptance><description>Common scripts for use in build/release pipelines</description><copyright>Copyright © 2021</copyright></metadata><files><file src="Script.ps1"></file></files></package>
It installs fine into another project, but Script.ps1
doesn't get extracted.
Is it possible to have my package's contents extracted at installation time? If so, how do I do this?
That said... if I'm barking up the wrong tree here, if there's a better way to accomplish my end goal of script reuse in pipelines, I'd be pleased to hear about it. (YAML isn't an option presently; I'm using Classic pipelines.)