Device Management PowerShell Cmdlets

This module exposes cmdlets that calls into SetupAPI functions and provides device enumeration and management functions.

 
 
 
 
 
4.6 Star
(24)
39,596 times
Add to favorites
Hardware
9/24/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • 2016
    2 Posts | Last post July 06, 2017
    • Why won't it work on 2016? Is there a 2016-equivalent of this?
    • Same issue on 2016. 
      
      Get-Device : Error calling SetupDiGetDeviceProperty()
      At line:1 char:1
      + Get-Device
      + ~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Get-Device], Win32Exception
          + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,DeviceManager.Commands.GetDeviceCommand
  • Download verification
    1 Posts | Last post May 12, 2017
    • as per subject, would be safer to publish the hash sums in order to verify the correctness of the archive.
      
  • As a nuget/package?
    1 Posts | Last post December 22, 2016
    • Is it possible to add this to the PowerShell package repo. So that it can be installed as:
      
      
      Install-Package DeviceManagement
  • Still a problem with Windows 8.1 64-bit?
    3 Posts | Last post February 28, 2016
    • I see a number of people with the same error I am getting - is there any resolution to this? Get-driver works fine but get-device results in:
      
      get-device : Error calling SetupDiGetDeviceProperty()
      At line:1 char:1
      + get-device
      + ~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Get-Device], Win32Exception
          + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,DeviceManager.Commands.GetDeviceCommand
    • I had a script working using the "Get-Device"-function and suddenly I got the error message above when starting the script! There must have been a change coming with a Windows-update or something, this was the only possible change in my system... (Win8.1 x64)
    • Run as admin. Or make a bat file to run it as admin.
  • Doesn't work on Windows 10 64bit
    4 Posts | Last post February 28, 2016
    • Just to save someone else some trouble, Get-Device doesn't work on Windows 10.  Suggest you try DevCon.exe instead (https://msdn.microsoft.com/en-us/library/windows/hardware/ff544746%28v=vs.85%29.aspx)
    • If this module does not work, take a look at https://gallery.technet.microsoft.com/PowerShell-Device-60d73bb0. This is tested on Windows 2008R2, 2012R2 and 2016 Preview 4.
    • sorry, the link was wrong: https://gallery.technet.microsoft.com/PowerShell-Device-60d73bb0
    • Get-Device worked for me.. I'm on Windows 10. One problem I did run into is that my script required to be run as administrator. Maybe that's the case for you? Or, Maybe you have to run Windows Powershell ISE as administrator. Anyway, good luck. I'm such a noob.
  • windows 10 problem
    2 Posts | Last post October 15, 2015
    • mport-Module : No se puede cargar el archivo o ensamblado
      'file:///C:\Users\garf\Desktop\DeviceManagement\Release\DeviceManagementCmdlet.dll' ni una de sus dependencias.
      Operación no admitida. (Excepción de HRESULT: 0x80131515)
      En línea: 1 Carácter: 1
      + Import-Module .\DeviceManagement.psd1
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
          + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
    • You need to unblock the zip before unzipping. (Unblocking individual bits after unzipping didn't work for me.)
  • Problem with Windows Server 2012 R2 datacenter
    1 Posts | Last post August 11, 2015
    • Hi,
      
      I need your help with the following error:
      
      Get-Device : Error calling SetupDiGetDeviceProperty()
      At C:\Users\dtpsupport\Desktop\prueba\RemoveNetworkAdapter.ps1:7 char:1
      + Get-Device -ControlOptions DIGCF_ALLCLASSES | Sort-Object -Property Name | Where ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Get-Device], Win32Exception
          + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,DeviceManager.Commands.GetDeviceCommand
      
      
      Thanks,
      
  • Not working with remote session
    2 Posts | Last post March 13, 2015
    • Example:
      
      PS> New-PSSession test | Enter-PSSession
      [test]: PS> Import-Module DeviceManagement
      Import-Module : The current Windows PowerShell host is: 'ServerRemoteHost' (version 1.0.0.0). The module 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DeviceManagement\DeviceManagement.psd1' requires a minimum Windows PowerShell host version of '3.0' to run.
      
      Client is Windows 8, Server - Hyperv Server 2012 R2
    • A quick workaround:
      
      $c = gc "$Env:ProgramFiles\WindowsPowerShell\Modules\devicemanagement\devicemanagement.psd1"
      $c | % { $_ -replace "PowerShellHostVersion = '3.0'","PowerShellHostVersion = '1.0'" } | Set-Content "$Env:ProgramFiles\WindowsPowerShell\Modules\devicemanagement\devicemanagement.psd1"
      
      This effectively disables the host version check. The module seems to work correctly.
      
      As for the cause: I assume the author intended to require PowerShell version 3.0+, not version 3.0+ of an unspecified PS host program. PowerShellVersion should be used to enforce this, not PowerShellHostVersion (which only makes sense when PowerShellHost is also specified).
  • Remove or rescan device
    1 Posts | Last post February 16, 2015
    • Hi,
      
      I have Broadcom nic installed in a 2012 core server. Windows did not detect it so I had to extract a driver file and load an .inf file using pnputil.exe.
      
      When I do a get-device I see that this nic is still listed with
      configurationflags = configflag_failedinstall
      installstate = installstatefailedinstall
      
      
      Is there a way to fix this using a ps cmdlet? Maybe by doing a rescan of device or by removing the device so it can be detected again?
      
      Tnnx
  • Can we get source?
    1 Posts | Last post January 02, 2015
    • Fails for me on windows 8.1 with
      
      `Error calling SetupDiCallClassInstaller`
      
      doing some digging, a few people online suggest this is due to an x64/x32 bit mismatch. Can we get source so that I can try to resolve this?
1 - 10 of 17 Items