2 Replies Latest reply on Jul 5, 2018 5:34 AM by RAAJ

    powershell script pnputil.exe

    RAAJ Rookie

      Bonjour,

      where can i find scripts powershell for install drivers.

       

      i use this script:

      $log = "c:\windows\temp\sierra.log"

      Get-childitem  -recurse -include *.inf | foreach-object{C:\Windows\System32\PNPUtil.exe /add-driver $_.fullname /install} > $log

       

      it's ok on pc

       

      but with a task pnputil.exe is not reconize

       

      we are on Windows 10 64 bits.

       

       

      thanks for helps.

        • 1. Re: powershell script pnputil.exe
          phoffmann SupportEmployee

          Hi - I've deleted your attached SDCLIENT log file, as it contained names to your Core-server (you want to anonymise such things before posting them on a publically accessible forum).

           

          Your problem is here:

          VRBOSE Thu, 05 Jul 2018 09:30:45 Running sdistps1 (as user 0) command line '"C:\Program Files (x86)\LANDesk\LDClient\sdistps1.exe"'
          VRBOSE Thu, 05 Jul 2018 09:30:45 PostLaunch: input=<params><ScriptArguments/><ShowUI>false</ShowUI><Signed>false</Signed><UseWow64FsRedirection>true</UseWow64FsRedirection><action>RunPowerShell</action><curdir>C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ld_repository$\Packages\Logiciels\sierra</curdir><script>C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ld_repository$\Packages\Logiciels\sierra\paquet_sierra.ps1</script><timeout>-1</timeout></params>
          LOG    Thu, 05 Jul 2018 09:30:55 PowerShell output: C:\Windows\System32\PNPUtil.exe : Le terme ®C:\Windows\System32\PNPUtil.exe¯ 
          n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script 
          
          ou programme ex‚cutable. V‚rifiez l'orthographe du nom, ou si un chemin 
          
          d'accŠs existe, v‚rifiez que le chemin d'accŠs est correct et r‚essayez.
          
          Au caractŠre C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ld_repository$\Pa
          
          ckages\Logiciels\sierra\paquet_sierra.ps1:3 : 58
          
          + ... nclude *.inf | foreach-object{C:\Windows\System32\PNPUtil.exe /add-dr ...
          
          +                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          
              + CategoryInfo          : ObjectNotFound: (C:\Windows\System32\PNPUtil.exe 
          
             :String) [], CommandNotFoundException
          
              + FullyQualifiedErrorId : CommandNotFoundException
          
          
          

           

          We're trying to run the command, but you have a weird (R) character before the path, see here -- ®C:\Windows\System32\PNPUtil.exe¯ -- so it looks like your "-s are replaced by weird characters that shouldn't be there.

           

          I'm guessing that's the problem of your script - some non-printable characters have snuck in!

          • 2. Re: powershell script pnputil.exe
            RAAJ Rookie

            Thank you for the core, and thank you for the answer i try to change my script.