Closed danmetzler closed 2 years ago
I'm thinking this might work better if $au_GalleryUrl
, or its replacement $au_GalleryPackageRootUrl
(#250), were also implemented as part of the $Options
parameter for Update-AUPackages
.
Update-Package
.Update-Package
could then have logic to set the global variable if $Options.GalleryPackageRootUrl exists.There may be other ways to address this, but that's one option that should work.
While thinking about this, just a side comment. I see data passed into Update-AUPackages and Update-Package using parameters, global variables set outside the AU module code, and environment variables. It seems like some things are available as an environment varirable, and others aren't. Is there a strategy around when something is implemented as global variable vs environment variable vs parameter vs combination of those?
No particular strategy. Just organic growth. Should be env vars.
While working on #250, I discovered that
$au_GalleryUrl
is implemented as a variable in the logic ofUpdate-Package
, but it is not implemented as a parameter or environment variable anywhere else.Update-Package
consumes.Update-AUPackages
callsUpdate-Package
inside of a job, usingStart-Job
.Start-Job
creates a new session, so global variables that exist in the session that runsUpdate-AUPackages
are not available toUpdate-Package
A work around is that we can set the global variable in every
update.ps1
script of each package, but this doesn't feel like the way it was intended.