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 }}
Repository navigation
Publish Current Version Info Only in tools/currentversion.sh & tools/currentversion.ps1 #3519
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
I am writing some scripts that need to pull the latest version of PowerShell (whether or not they are setup in a repo) - similar to tools/download.sh.
It would be great if you published something like tools/currentversion.sh (and currentversion.ps1) that contained:
release=v6.0.0-alpha.18
build=18
Then I could download and run that shell script in my code (at my own risk) and be able to pull the current version.
Other data might be helpful as well (maybe actual package files per platform target and their checksums?) - but at a minimum being able to auto-detect the current version would be very helpful!
changed the title [-]Publish Current Version Info Only in tools/currentversion.sh[/-][+]Publish Current Version Info Only in tools/currentversion.sh & tools/currentversion.ps1[/+]on Apr 9, 2017
Related Issues #1635#1395 Darwin (@DarwinJS) Please clarify what do you use "current version" for? I believe that preferred way is always to test the availability of features.
Ilya (@iSazonov) - it would allow me to build something similar to download.sh - which pulls the latest version of PowerShell for the target environment - but I would be in control of the details of what happens in the download.sh equivalent.
So within my script I would call something similar to this:
Ilya (@iSazonov) - I wouldn't be interested in using nuget for Linux. As far as Windows goes, I am already the maintainer for the Chocolatey package for PowerShell core: https://chocolatey.org/packages/powershell-core and can pull down chocolatey and PowerShell core with a oneliner if it is needed.
I'm not sure that it makes sense to have yet another script to manually update every time we do a release.
(Invoke-RestMethod https://api.github.com/repos/powershell/powershell/releases/latest).tag_name should give you the latest version string today. If you need something else that's not provided there, I'd love to get some more info.
Joey Aiello (@joeyaiello) - this script is to bootstrap PowerShell itself so I can't use invoke-restmethod - do you know a simple a bash equivalent using curl or wget? I think wget may be more prevalent - I am having to install it on Ubuntu.
This is on machines that were freshly built and like download.sh I want to use only utilities already on the system - not have to install git or other utilities just to pull the tag.
Great link - I was able to craft a solution based on a pure curl + sed example!
FYI - I thought your build chain would have been capable of writing an updated currentversion.sh - wouldn't want to rely on someone remembering to update a manually edited file.
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
Activity
[-]Publish Current Version Info Only in tools/currentversion.sh[/-][+]Publish Current Version Info Only in tools/currentversion.sh & tools/currentversion.ps1[/+]iSazonov commentedon Apr 10, 2017
Related Issues #1635 #1395
Darwin (@DarwinJS) Please clarify what do you use "current version" for? I believe that preferred way is always to test the availability of features.
DarwinJS commentedon Apr 10, 2017
Ilya (@iSazonov) - it would allow me to build something similar to download.sh - which pulls the latest version of PowerShell for the target environment - but I would be in control of the details of what happens in the download.sh equivalent.
So within my script I would call something similar to this:
For languages other than bash, the file could be pulled and parsed as key value pairs.
iSazonov commentedon Apr 10, 2017
Can you use nuget?
DarwinJS commentedon Apr 10, 2017
Ilya (@iSazonov) - I wouldn't be interested in using nuget for Linux. As far as Windows goes, I am already the maintainer for the Chocolatey package for PowerShell core: https://chocolatey.org/packages/powershell-core and can pull down chocolatey and PowerShell core with a oneliner if it is needed.
joeyaiello commentedon Apr 10, 2017
I'm not sure that it makes sense to have yet another script to manually update every time we do a release.
(Invoke-RestMethod https://api.github.com/repos/powershell/powershell/releases/latest).tag_nameshould give you the latest version string today. If you need something else that's not provided there, I'd love to get some more info.DarwinJS commentedon Apr 10, 2017
Joey Aiello (@joeyaiello) - this script is to bootstrap PowerShell itself so I can't use invoke-restmethod - do you know a simple a bash equivalent using curl or wget? I think wget may be more prevalent - I am having to install it on Ubuntu.
This is on machines that were freshly built and like download.sh I want to use only utilities already on the system - not have to install git or other utilities just to pull the tag.
Thanks for any help!
joeyaiello commentedon Apr 10, 2017
curlwill get you the JSON block just fine, but then you have to parse it. It's relatively painless if you've got Python, but if you're stuck with basic coreutils, check this out: http://stackoverflow.com/questions/1955505/parsing-json-with-unix-toolsDarwinJS commentedon Apr 11, 2017
Great link - I was able to craft a solution based on a pure curl + sed example!
FYI - I thought your build chain would have been capable of writing an updated currentversion.sh - wouldn't want to rely on someone remembering to update a manually edited file.
iSazonov commentedon Apr 11, 2017
Darwin (@DarwinJS) It seems #3521 is related.
DarwinJS commentedon Apr 11, 2017
Did a PR to make download.sh detect version rather than have hard codes: #3535
iSazonov commentedon Sep 22, 2017
The Issue was resolved in #3608
DarwinJS commentedon Sep 22, 2017
The best resolution is actually in: #3586