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

An Error #4

Open
SlavaSQL opened this issue Sep 7, 2021 · 3 comments
Open

An Error #4

SlavaSQL opened this issue Sep 7, 2021 · 3 comments

Comments

@SlavaSQL
Copy link

SlavaSQL commented Sep 7, 2021

I've tried your code, but it returns an error:
**Get-PnpDevice : The term 'Get-PnpDevice' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:14 char:2

  • Get-PnpDevice -class Bluetooth |
    
  • ~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-PnpDevice:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException**

I assume the code has to verify if the function exists

@lflfm
Copy link
Owner

lflfm commented Sep 7, 2021

weird; I never saw this error... are you sure you're using powershell?
Can you give more details about the system? Windows version, powershell version, and the results of this command Get-ExecutionPolicy -list?

@SlavaSQL
Copy link
Author

SlavaSQL commented Sep 8, 2021

I think the module where "Get-PnpDevice" is located just not installed in my system

Windows 8.1
Name Value


PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.19170
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

Scope ExecutionPolicy


MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned

@lflfm
Copy link
Owner

lflfm commented Sep 8, 2021

ah, yes; PnpDevice is new in Windows 10. I wasn't aware of this.
https://docs.microsoft.com/en-us/powershell/module/pnpdevice/
There does seem to be an alternative which you could look into and perhaps send a pull-request 😎: https://community.spiceworks.com/topic/2137123-get-pnpdevice-not-working-in-powershell

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

2 participants