-
-
Save pythoninthegrass/675b625f1623635c8e3141ca4a4ca85a to your computer and use it in GitHub Desktop.
Remove all OEM drivers from an offline image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$image = “D:\Windows\System32\DriverStore\FileRepository” # may just need mounted Windows root dir (e.g., "D:\") | |
$dism = dism /image:$image /get-drivers | |
ForEach($line in $dism){ | |
If($line -like “Published Name*”){ | |
$sp = ($line -split “ “) | |
$oem = $sp[3] | |
Dism /image:$image /Remove-Driver /Driver:$oem # /Recurse | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment