powerBTremover icon indicating copy to clipboard operation
powerBTremover copied to clipboard

An Error

Open SlavaSQL opened this issue 3 years ago • 3 comments

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

SlavaSQL avatar Sep 07 '21 01:09 SlavaSQL

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?

lflfm avatar Sep 07 '21 18:09 lflfm

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

SlavaSQL avatar Sep 08 '21 12:09 SlavaSQL

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

lflfm avatar Sep 08 '21 15:09 lflfm