Skip to content

Commit 14071fc

Browse files
committed
chore: Add Microsoft example
1 parent d6b7847 commit 14071fc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Install-ModelDrivers/install_model_drivers.ps1

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,27 @@
2222
.PARAMETER SkipCleanup
2323
[OPTIONAL] Don't cleanup temporary folders or registry keys.
2424
.EXAMPLE
25-
.\install_drivers.ps1 -Manufacturer Lenovo -Model 20y0
25+
.\install_model_drivers.ps1 -Manufacturer Lenovo -Model 20y0
2626
2727
Downloads Lenovo driver installer matching the regex 20y0 exact string to
2828
"$env:TEMP\Lenovo" then installs the drivers from the expanded installer.
2929
.EXAMPLE
30-
.\install_drivers.ps1 -Manufacturer HP -Model Z440
30+
.\install_model_drivers.ps1 -Manufacturer HP -Model Z440
3131
3232
Downloads HP driver installer matching the regex Z440 exact string to
3333
"$env:TEMP\HP" then installs the drivers from the expanded installer.
34-
3534
.EXAMPLE
36-
.\install_drivers.ps1 -Manufacturer Dell -Model 9380
35+
.\install_model_drivers.ps1 -Manufacturer Dell -Model 9380
3736
3837
Downloads Dell driver installer matching the regex 9380 exact string to
3938
"$env:TEMP\Dell" then installs the drivers from the expanded installer.
39+
.EXAMPLE
40+
.\install_model_drivers.ps1 -Manufacturer Microsoft -Model
41+
'Surface Laptop 4 with Intel Processor'
42+
43+
Downloads Microsoft driver installer matching the regex '
44+
Surface Laptop 4 with Intel Processor' exact string to "$env:TEMP\Microsoft"
45+
then installs the drivers via the msi installer.
4046
#>
4147

4248
[CmdletBinding()]
@@ -115,7 +121,7 @@ function Get-RegexMatch {
115121
$match_index = 1
116122
}
117123
# Microsoft hides their links behind (at least) two clicks...
118-
'Microsoft' {
124+
'MICROSOFT' {
119125
$manufacturer_uri = 'https://learn.microsoft.com/en-us/surface/manage-surface-driver-and-firmware-updates'
120126
# Example: <a href="https://www.microsoft.com/download/details.aspx?id=102924" data-linktype="external">Surface Laptop 4 with Intel Processor</a>
121127
$file_regex = "(\d{6})(?:`" data-linktype=`"external`">$Model)"
@@ -177,7 +183,7 @@ function Invoke-Installer {
177183
'HP' {
178184
$arg_list = @('-s', '-f', $Destination)
179185
}
180-
'Microsoft' {
186+
'MICROSOFT' {
181187
$arg_list = @('/qn', '/norestart')
182188
}
183189
default { throw "Manufacturer [$Manufacturer] is not (yet) supported..." }

0 commit comments

Comments
 (0)