Skip to content

Fix #2678: Suppress Get-CimInstance access denied error#2695

Draft
nohwnd wants to merge 1 commit intopester:mainfrom
nohwnd:fix-2678-ciminstance
Draft

Fix #2678: Suppress Get-CimInstance access denied error#2695
nohwnd wants to merge 1 commit intopester:mainfrom
nohwnd:fix-2678-ciminstance

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Apr 3, 2026

Fix #2678

Added -ErrorAction Ignore to Get-CimInstance and Get-WmiObject calls in Get-RunTimeEnvironment with null fallback when not running as Administrator.

Copilot-generated fix.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

@nohwnd
Copy link
Copy Markdown
Member Author

nohwnd commented Apr 3, 2026

tests

Copilot-generated fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nohwnd nohwnd force-pushed the fix-2678-ciminstance branch from f34f9c8 to 5d6abc8 Compare April 3, 2026 10:18
@nohwnd
Copy link
Copy Markdown
Member Author

nohwnd commented Apr 3, 2026

🤖 Tests added in latest push — verifies Get-RunTimeEnvironment returns expected keys without throwing.

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.

Get-CimInstance (non failing) error when running Pester not as Administrator

1 participant