Discussion:
HowTo: Install missing hardware drivers using powershell script
(too old to reply)
unknown
2009-07-01 11:29:01 UTC
Permalink
I would like to be able to create a script that would install missing device
drivers for systems after I deploy an operating system image and after
running sysprep mini setup but I don't know where to start.

I would like the script to be able to deal with different hardware
configurations as well. All necessary device drivers will be available on the
C drive in a set folder but would appreciate any help getting me starting
with my first script
--
Michael
Vadims Podans [MVP]
2009-07-01 18:29:27 UTC
Permalink
and where you have issue? Have you sample code?
--
WBR, Vadims Podans
MVP: PowerShell
PowerShell blog - www.sysadmins.lv
Post by unknown
I would like to be able to create a script that would install missing device
drivers for systems after I deploy an operating system image and after
running sysprep mini setup but I don't know where to start.
I would like the script to be able to deal with different hardware
configurations as well. All necessary device drivers will be available on the
C drive in a set folder but would appreciate any help getting me starting
with my first script
--
Michael
unknown
2009-07-02 09:40:01 UTC
Permalink
I don't have sample code because I don't know where to start. I'm very new to
scripts and have no experience of powershell at all
--
Michael
Post by Vadims Podans [MVP]
and where you have issue? Have you sample code?
--
WBR, Vadims Podans
MVP: PowerShell
PowerShell blog - www.sysadmins.lv
Post by unknown
I would like to be able to create a script that would install missing device
drivers for systems after I deploy an operating system image and after
running sysprep mini setup but I don't know where to start.
I would like the script to be able to deal with different hardware
configurations as well. All necessary device drivers will be available on the
C drive in a set folder but would appreciate any help getting me starting
with my first script
--
Michael
unknown
2009-07-02 11:58:01 UTC
Permalink
Maybe if i asked a more direct question to start.

How would I get a powershell script to run .exe and .msi programs?
--
Michael
Post by unknown
I don't have sample code because I don't know where to start. I'm very new to
scripts and have no experience of powershell at all
--
Michael
Post by Vadims Podans [MVP]
and where you have issue? Have you sample code?
--
WBR, Vadims Podans
MVP: PowerShell
PowerShell blog - www.sysadmins.lv
Post by unknown
I would like to be able to create a script that would install missing device
drivers for systems after I deploy an operating system image and after
running sysprep mini setup but I don't know where to start.
I would like the script to be able to deal with different hardware
configurations as well. All necessary device drivers will be available on the
C drive in a set folder but would appreciate any help getting me starting
with my first script
--
Michael
Joel Bennett
2009-07-03 05:24:53 UTC
Permalink
just run them, for instance, the following 3-line script will work fine:

Write-Host "Hello World"
C:\Windows\System32\cmd.exe /c echo %computername%
C:\Users\You\Downloads\SomeInstaller.msi

... will work fine ...
--
Joel
Post by unknown
Maybe if i asked a more direct question to start.
How would I get a powershell script to run .exe and .msi programs?
CommandBreak
2009-07-08 12:38:01 UTC
Permalink
you can get a list of devices that are in an errored state using the
following one-liner

Get-WmiObject Win32_PNPEntity | Where-Object{$_.ConfigManagerErrorcode -ne 0}

the ConfigManagerErrorcode property is the one you are interested in, and
there are many different values, check out
http://msdn.microsoft.com/en-us/library/aa394353(VS.85).aspx for more info.

as you are new to scripting, i suggest you try and approach this problem the
following way:

1. create a catalogue of DeviceID for all types of hardware you care about.
2. put an action against each of these id's, installing an application as
suggested by Joel.
3. run your script against a test target, review the results.

=== stretch goals
4. to make it extensible you might want to think about reporting on dev id's
that aren't in your catalogue already
5. wmi works remotely so you can run this from a central pc/server and
collect the results

happy scripting
Post by Joel Bennett
Write-Host "Hello World"
C:\Windows\System32\cmd.exe /c echo %computername%
C:\Users\You\Downloads\SomeInstaller.msi
.... will work fine ...
--
Joel
Post by unknown
Maybe if i asked a more direct question to start.
How would I get a powershell script to run .exe and .msi programs?
Loading...