Skip to content

[Bug]: Get-WGinstalled throws an exception if the 'wg' job doesn't exist #26

@HollisTech

Description

@HollisTech

Describe the problem

There was a problem with MSFT backend for winget on 4/9/2025 and that caused winget.exe to abort. The function Get-WGinstalled threw an exception at line 122 executing:
if (Get-Job -Name wg ) {
because there was no job named 'wg'.
Simply changing that line to:
if (Get-Job -Name wg -ErrorAction Ignore) {
resolves the problem and meets the intention of the conditional expression.

Expectation

Exceptions should be caught or avoided.

Additional Information

No response

PowerShell version

4.0

Platform

None

Additional Checks

  • You are using the latest version of this module.
  • You have read this repository's README file.
  • You have read full help and examples for the command you are having problems with.
  • You are running PowerShell in an elevated session.
  • You are running in a traditional PowerShell console or Windows Terminal

Metadata

Metadata

Labels

bugSomething isn't workingtriagenew issue that needs review

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions