Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RefreshEnv broken on Windows 11 24H2 - missing wmic.exe #3524

Open
6 tasks done
mwallner opened this issue Oct 3, 2024 · 2 comments
Open
6 tasks done

RefreshEnv broken on Windows 11 24H2 - missing wmic.exe #3524

mwallner opened this issue Oct 3, 2024 · 2 comments
Labels

Comments

@mwallner
Copy link
Member

mwallner commented Oct 3, 2024

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

On the latest LTSC release of Windows 11, the "wmic" utility has been removed.

What is Expected?

RefreshEnv should work whether wmic is available or not

How Did You Get This To Happen?

Using choco on the latest Win11 24h2 family releases.

System Details

  • Operating System: Win11 24H2 LTSC
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.2.2
  • Chocolatey Licensed Extension version: -
  • Chocolatey License type:
  • Terminal/Emulator: powershell / conhost

Installed Packages

-

Output Log

-

Additional Context

No response

@mwallner mwallner added the Bug label Oct 3, 2024
@mwallner
Copy link
Member Author

Whoever stumbles upon this, note that usage of Update-SessionEnvironment still works - so if it's possible consider using PowerShell instead of .bat.
(directly using refreshenv from a PowerShell script shouldn't be necessary anyway)

@corbob corbob changed the title RefreshEnv broken on Windows 11 24H2 LTSC - missing wmic.exe RefreshEnv broken on Windows 11 24H2 - missing wmic.exe Dec 20, 2024
@corbob
Copy link
Member

corbob commented Dec 20, 2024

I've updated the title as this is actually just in 24H2 Windows 11: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242.

The script isn't entirely broken without wmic installed, more it emits an error and then refreshes the environment for cmd.exe. This is different from when it's run inside of powershell.exe where it reports that you should import the module and then run it again. Perhaps the update should be to always warn that it doesn't work for PowerShell and then still do the refresh for cmd 🤷‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants