The value of $DeviceID
is : "PCI\VEN_8086&DEV_9D3A&SUBSYS_225617AA&REV_21\3&11583659&1&B0"
I'm trying to search for that string in .INF files with "Select-String" :
Select-String -Path C:\file.inf -Pattern "$DeviceID"
But it won't take the string as is, it's having a problem with the "\V":
Select-String : La chaîne PCI\VEN_8086&DEV_9D3A&SUBSYS_225617AA&REV_21\ 3&11583659&1&B0 n’est pas une expression régulière valide: analyse de "PCI\VEN_8086&DEV_9D3A&SUBSYS_225617AA&REV_21\3&11583659&1&B0" - Séquence d'échappement \V non reconnue. Au caractère Ligne:15 : 5 + Select-String -Path $($_.FullName) -pattern "$($erreur.DeviceID)" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument : (:) [Select-String], ArgumentException + FullyQualifiedErrorId : InvalidRegex,Microsoft.PowerShell.Commands.SelectStringCommand
Sorry for the french but it basically says "String is not a valid regex. Escape sequence \V not recognized".