driver - powershell pass .inf files to pnputil -
i trying recursively search directory, find .inf files within , pass files pnputil add drivers windows drivers directory.
i have following:
cd /drivers $x = ls -path . -filter "*.inf" -recurse -erroraction silentlycontinue foreach ($i in $x){ pnputil /a $i }
and following error pnputil:
adding driver package failed : invalid inf passed parameter.
i assuming it's failing because pnputil doesn't object it's getting. suggestion pass it, or modify?
thank you!
you knew issue was. passing object command line. need extract full path system.io.fileinfo
object pass pnputil
foreach ($i in $x){ & pnputil /a $i.fullname }
that should results looking for. thing have done change $x
array of file names. -expandproperty
being important part.
$x = ls -path . -filter "*.inf" -recurse -erroraction silentlycontinue | select-object -expandproperty fullname foreach ($i in $x){ pnputil /a $i }
Comments
Post a Comment