Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Select-String Pattern

$
0
0

Hello,

I have this script:

cls
$InetDrop = "c:\Temp"
$contains_stagingSP2010 = 	Get-childItem $InetDrop -filter *.eml -Recurse | `
							Select-String -Pattern ((' Staging *') -or (' SStaging *')) -AllMatches | `
							Select-Object Path,Filename
Write-Host $contains_stagingSP2010

In one of the files, there is the value Staging .Net included. but the result of my script is null.

How can i use -pattern with -or and -and ?


Thanks Horst MOSS 2007 Farm; MOSS 2010 Farm; TFS 2010; IIS 7.5


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>