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

Error for Get-Device #3

Open
eabase opened this issue May 8, 2023 · 10 comments
Open

Error for Get-Device #3

eabase opened this issue May 8, 2023 · 10 comments

Comments

@eabase
Copy link

eabase commented May 8, 2023

Get-Device | Out-GridView

Gives:
Get-Device: Error calling SetupDiGetDeviceProperty()

@ethzero
Copy link

ethzero commented Jun 23, 2023

Same, for fresh install. Windows 10/PowerShell 7.2.11

@BertV1
Copy link

BertV1 commented May 5, 2024

Same thing. Even if i try to filter on certain devices.
This command was the only reason I acquired the module (alternative to using WMI)

@TobiasPSP
Copy link
Owner

Did you try running it with admin privileges? I need to check but it may require elevation to get read access.

@BertV1
Copy link

BertV1 commented May 5, 2024

Yes, I did, for me this did not help. @TobiasPSP
I've read somewhere that this function requires Vista or later, but I am running this on W10/pwsh 7.0.0

@TobiasPSP
Copy link
Owner

I‘ll investigate today, too. At publishing time, this obviously worked for me. Did you ever use it with PowerShell 5 where it was originally created?
Thanks!

@BertV1
Copy link

BertV1 commented May 6, 2024

I've tried it with PS5.1 (admin mode); it produces the same error:

get-device : Error calling SetupDiGetDeviceProperty()
At line:1 char:1
+ get-device
+ ~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Device], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,DeviceManager.Commands.GetDeviceCommand

@TobiasPSP
Copy link
Owner

I just reinstalled the module on a test system running Windows 10. Both examples work as expected. I am displaying below only the first 10 results to not overflow the thread, but I can confirm that without that limitation, still all information is outputted without errors:

PS C:\> Get-Driver | Select-Object -First 10

Description                    ManufacturerName  ProviderName DriverDate
-----------                    ----------------  ------------ ----------
TKR TerboLine 19k2             TKR               Microsoft    21.06.2...
Remote Desktop Device Redir... Microsoft         Microsoft    21.06.2...
Generic USB-EEM Network Ada... Microsoft         Microsoft    21.04.2...
Windows KDNET USB-EEM Netwo... Microsoft         Microsoft    21.04.2...
Windows KDNET USB3.0-EEM Ne... Microsoft         Microsoft    21.04.2...
Windows KDNET USB Network A... Microsoft         Microsoft    21.04.2...
Standard Serial over Blueto... Microsoft         Microsoft    21.06.2...
SDF Launcher                   Microsoft         Microsoft    21.06.2...
Microsoft RemoteFX Synth3D ... Microsoft         Microsoft    21.06.2...
Simple Device Orientation S... Microsoft         Microsoft    21.04.2...


PS C:\> Get-Device | Select-Object -First 10

Name                                IsPresent HasProblem InstallState
----                                --------- ---------- ------------
HID-compliant system controller    True      False      InstallState...
HID-compliant vendor-defined dev... True      False      InstallState...
Intel(R) Control Logic             True      False      InstallState...
Generic Attribute Profile          True      False      InstallState...
Killer Networking Software         True      False      InstallState...
HID-compliant consumer control d... True      False      InstallState...
Motherboard resources              True      False      InstallState...
Motherboard resources              True      False      InstallState...
Motherboard resources              True      False      InstallState...
Realtek Asio Component             True      False      InstallState...

Since I cannot repro the case right now, let's brainstorm:

  • What OS are you using?
  • Is there maybe a specific device that you have installed that may wreck havoc?
  • Or am I misunderstanding the problem?

@TobiasPSP
Copy link
Owner

I ran the commands as non-elevated user BTW. Admin privs are not required.

@BertV1
Copy link

BertV1 commented May 7, 2024

@TobiasPSP Thanks for the confirmation that it should work.
Tbh i'm perplexed because get-driver works.
For the record, I've only reinstalled the package in the same way I previously did:

install-module -name devicemanagement -verbose
import-module -name devicemanagement -verbose

I did not reboot my pc (not that it would logically matter, but i want to accentuate how the state of my system did not change).

Get-Device still produces the same error.
I'm currently running this on a win 10 pro 22h2

@BertV1
Copy link

BertV1 commented May 7, 2024

Is there maybe a specific device that you have installed that may wreck havoc?

Not that I am aware of, hèh. Everything should work as expected (if you want i could post devcon output in a PM, but i believe everything is OK)

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

No branches or pull requests

4 participants