Skip to content

Conversation

@KexyBiscuit
Copy link
Contributor

@KexyBiscuit KexyBiscuit commented Feb 8, 2025

The executable name can be pwsh, pwsh-preview, powershell, or powershell-preview. The new regular expression matches them all.

Fixes #240053.

@KexyBiscuit
Copy link
Contributor Author

KexyBiscuit commented Feb 8, 2025

regex101 of the current broken expression: https://regex101.com/r/hBBZU2/3
regex101 of the new working expression: https://regex101.com/r/JjTL5D/3
regex101 of the latest working expression: https://regex101.com/r/AIJQpC/1

@KexyBiscuit

This comment was marked as outdated.

KexyBiscuit added a commit to AOSC-Tracking/vscodium that referenced this pull request Feb 11, 2025
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
KexyBiscuit added a commit to AOSC-Tracking/vscodium that referenced this pull request Feb 11, 2025
Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
The powershell-preview snap provides `powershell-preview` command, make
the regular expression detects that too.

```shell
kexybiscuit@ProArtB550-CREATOR:~$ snap info powershell-preview
name:      powershell-preview
summary:   PowerShell for every system!
publisher: Microsoft PowerShell✓
store-url: https://snapcraft.io/powershell-preview
contact:   https://github.com/powershell/powershell
license:   unset
description: |
  PowerShell is an automation and configuration management platform.
  It consists of a cross-platform (Windows, Linux, and macOS)
  command-line shell and associated scripting language.

  See https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle for support
  details.
commands:
  - powershell-preview
snap-id:      D0A7ph8R6LBXQ8rgs2ad06s8tjyeowsd
tracking:     latest/stable
refresh-date: today at 14:12 CST
channels:
  latest/stable:    7.6.0-preview.2 2025-01-27 (165) 77MB classic
  latest/candidate: ↑
  latest/beta:      ↑
  latest/edge:      7.4.0-preview.3 2023-05-03 (142) 72MB classic
installed:          7.6.0-preview.2            (165) 77MB classic
kexybiscuit@ProArtB550-CREATOR:~$ sudo snap install powershell-preview --classic
2025-02-08T14:12:33+08:00 INFO Waiting for automatic snapd restart...
powershell-preview 7.6.0-preview.2 from Microsoft PowerShell✓ installed
kexybiscuit@ProArtB550-CREATOR:~$ command -v powershell-preview
/snap/bin/powershell-preview
```

Co-authored-by: Garfield Lee <Garfield550@users.noreply.github.com>
Signed-off-by: Kexy Biscuit <kexybiscuit@outlook.com>
@KexyBiscuit KexyBiscuit changed the title Fix PowerShell executable name detection. Feb 14, 2025
@KexyBiscuit
Copy link
Contributor Author

@Tyriar this is a follow-up of #240234 (actually a duplicate of #240053), please review.

@Tyriar Tyriar assigned Tyriar and unassigned aiday-mar Feb 14, 2025
@Tyriar Tyriar added this to the February 2025 milestone Feb 14, 2025
@Tyriar Tyriar enabled auto-merge February 21, 2025 15:04
@Tyriar Tyriar merged commit 13369a2 into microsoft:main Feb 21, 2025
7 checks passed
@KexyBiscuit KexyBiscuit deleted the regex-is-hard-pwsh branch February 21, 2025 23:39
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Apr 7, 2025
Drop upstreamed patch from microsoft/vscode#240054.

Co-authored-by: 白铭骢 (Mingcong Bai) (@MingcongBai) <jeffbai@aosc.io>
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Apr 7, 2025
Drop upstreamed patch from microsoft/vscode#240054.

Co-authored-by: 白铭骢 (Mingcong Bai) (@MingcongBai) <jeffbai@aosc.io>
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

4 participants