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

Make sure alias gwmi is available #1808

Open
wants to merge 1 commit into
base: live
Choose a base branch
from

Conversation

soyfrien
Copy link

@soyfrien soyfrien commented Oct 15, 2022

gwmi is used in a loop, and when missing leads to high error message noise, making the output difficult to interpret (see example screenshot).

Check for the alias, and temporarily create it if required.

PowerShell 7 shows terms it does not understand in the context of the command's syntax and line number, and uses red for the error message text, and blue for highlighting the term and line number. An example of the script's output when gwmi is not a valid alias.

A user runs the "Machine Profile Script" in PowerShell 7.
An example of the same system when gwmi is temporarily set to Get-WmiObject by the script.

`gwmi` is used in a loop, and when missing leads to high error message noise, making the output difficult to interpret.

Check for the alias, and temporarily create it if required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant