Search-OSDriverContent.ps1
<#
.LINK https://www.osdeploy.com/psmodule/osdrivers/ .SYNOPSIS Searches in INF files for a text string .DESCRIPTION Searches in INF files for a text string .PARAMETER Path Directory to search for INF files .PARAMETER Content Text string to search .PARAMETER Files Files to Include. Default is *.inf .EXAMPLE Search-OSDriverContent -Path C:\DeploymentShare\OSDrivers -Content "VEN_8086&DEV_1902" Searches in all INF files for "VEN_8086&DEV_1902". Results in Gridview .EXAMPLE Search-OSDriverContent -Path C:\DeploymentShare\OSDrivers -Files *.txt -Content "VEN_8086&DEV_1902" Searches in all TXT files for "VEN_8086&DEV_1902". Results in Gridview .NOTES NAME: Search-OSDriverContent.ps1 AUTHOR: David Segura, david@segura.org BLOG: http://www.osdeploy.com CREATED: 02/17/2018 VERSION: 1.1.0.1 #> function Search-OSDriverContent { [CmdletBinding()] Param ( [Parameter(Mandatory=$True)] [string]$Path, [string[]]$Files = '*.inf', [string]$Content ) Get-ChildItem "$Path" -Recurse -Include $Files -File | Select-String $Content | Select Path, Filename, LineNumber, Line | Out-Gridview -Title 'Search-OSDriverContent Results' } |