GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Please Start Versioning PowerShell.exe (So The latest version can be found by Get-Command) · Issue #5166 · PowerShell/PowerShell

Please Start Versioning PowerShell.exe (So The latest version can be found by Get-Command) #5166

New issue
Copy link
New issue
Copy link
Closed
Closed
Please Start Versioning PowerShell.exe (So The latest version can be found by Get-Command)#5166
Copy link
Assignees
SteveL-MSFT
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Maintainers-Buildspecific to affecting the buildspecific to affecting the build

Description

@DarwinJS
Darwin (DarwinJS)
opened on Oct 19, 2017
Issue body actions

Can't do the following from openssh installer to find the latest powershell core.

get-command "c:\program files\PowerShell*\PowerShell.exe"

So the weird thing is to do the same thing for any other default shell candidate from third parties - this would likely work - to, for instance, find the latest bash.exe

I can do a work around by using the versioned folder for now - but that only handles the default install location where the methodology of a versioned folder is followed by convention. If someone drops it in another folder or I try get-command against the file unpathed - I won't find a version.

There are obviously a lot of other reasons this should be done - just giving light to a very practical and current scenario.

Reacted by Mikey Lombardi (He/Him)

Activity

  1. iSazonov commented on Oct 19, 2017

    @iSazonov
    Ilya (iSazonov)
    on Oct 19, 2017
    Collaborator
    More actions

    It seems dup #4836 - we can discuss there.

  2. DarwinJS commented on Oct 19, 2017

    @DarwinJS
    Darwin (DarwinJS)
    on Oct 19, 2017
    ContributorAuthor
    More actions

    It is not really a duplicate - getting a version number to compile into the PE header should be a couple compiler settings. Additionally, you could have an exe emit it's version without coding the PE header.

    Both ways should be probably enabled, but importantly, the PE header can be examined without running the EXE.

  3. Steve Lee (SteveL-MSFT)
    added
    WG-Maintainers-Buildspecific to affecting the buildspecific to affecting the build
    on Oct 20, 2017
  4. Steve Lee (SteveL-MSFT)
    self-assigned this
    on Oct 20, 2017
  5. SteveL-MSFT commented on Oct 20, 2017

    @SteveL-MSFT
    Steve Lee (SteveL-MSFT)
    on Oct 20, 2017
    Member
    More actions

    #4836 is different. I think I can take care of this one and the icon one at the same time.

  6. iSazonov commented on Oct 21, 2017

    @iSazonov
    Ilya (iSazonov)
    on Oct 21, 2017
    Collaborator
    More actions

    The issue for Windows only. If we'll think about portability it is better to be based on SMA.dll to get a version by Get-Command.

    Reacted by Steve Lee
  7. SteveL-MSFT commented on Oct 21, 2017

    @SteveL-MSFT
    Steve Lee (SteveL-MSFT)
    on Oct 21, 2017
    Member
    More actions

    Darwin (@DarwinJS) what Ilya (@iSazonov) has found is that SMA.dll has file version information already with PSCore6 even on non-Windows. Since that is a core dll that will always be there with PowerShell, you can rely on it (with the exception of Windows PowerShell where SMA.dll is in the GAC and not in $PSHOME)

  8. DarwinJS commented on Oct 21, 2017

    @DarwinJS
    Darwin (DarwinJS)
    on Oct 21, 2017
    ContributorAuthor
    More actions

    I appreciate the tip. It would be great if it could be right in the EXEs like you all did with openssh.

    For instance, I was working on the ability for the openssh package to probe for which exe to use for the DefaultShell. By the time I got it done, I realized I would need to make sure they can only choose an EXE and should not be allowed to have any wildcards in the file name so that they are always going for a know file name and don't pickup unintention EXEs.

    Just wanted to give light to a use case where having it actually in the exe is not only what is generally expected on Windows - in this case it avoids custom code to go find the version for an EXE by looking in a DLL.

    Is it somehow more challenging to do it for powershell than it was for openssh?

  9. SteveL-MSFT commented on Oct 21, 2017

    @SteveL-MSFT
    Steve Lee (SteveL-MSFT)
    on Oct 21, 2017
    Member
    More actions

    Darwin (@DarwinJS) I have a PR opened for pwsh.exe on Windows, Ilya (@iSazonov)'s comment is that checking the version of pwsh.exe only works on Windows while checking version of SMA.dll works on all platforms.

  10. DarwinJS commented on Oct 21, 2017

    @DarwinJS
    Darwin (DarwinJS)
    on Oct 21, 2017
    ContributorAuthor
    More actions

    Steve Lee (@SteveL-MSFT) - thanks for clarifying! I was thinking it was being offered as a permanent alternative.

  11. iSazonov commented on Oct 22, 2017

    @iSazonov
    Ilya (iSazonov)
    on Oct 22, 2017
    Collaborator
    More actions

    I found SMA.dll idea in VS Code repo - they use that to enumerate PowerShells on all platforms.

  12. Travis Plunk (TravisEz13)
    closed this as completedin #5178on Oct 27, 2017
  13. Travis Plunk (TravisEz13)
    added a commit that references this issue on Oct 27, 2017

    use rcedit to embed icon and version information into pwsh.exe (#5178)

    This issue will close once commit 4df7036 is merged into the 'master' branch.
    4df7036
  14. Ilya (iSazonov)
    added
    Resolution-FixedThe issue is fixed.The issue is fixed.
    on Oct 27, 2017
  15. Thatgfsj (Thatgfsj)
    added a commit that references this issue on Aug 6, 2026

    use rcedit to embed icon and version information into pwsh.exe (Power…

    This issue will close once commit 9e0434e is merged into the 'master' branch.
    9e0434e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @SteveL-MSFT
    Steve Lee (SteveL-MSFT)

Labels

Resolution-FixedThe issue is fixed.The issue is fixed.WG-Maintainers-Buildspecific to affecting the buildspecific to affecting the build

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.