You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
While working on #250, I discovered that $au_GalleryUrl is implemented as a variable in the logic of Update-Package, but it is not implemented as a parameter or environment variable anywhere else.
The assumption is it will be passed in as a global variable that Update-Package consumes.
Update-AUPackages calls Update-Package inside of a job, using Start-Job.
Start-Job creates a new session, so global variables that exist in the session that runs Update-AUPackages are not available to Update-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.
The text was updated successfully, but these errors were encountered:
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.
Logic already exists to pass the $Options into the job that calls 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?
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.The text was updated successfully, but these errors were encountered: