Hey guys,
I am trying to have my script run through a folder and display back results that meet its criteria. I have been able to do this but now I wanted to add a variable so it would only display the last few hits and not all 100+. Any help is appreciated.
$org = ""$howmany = ""
while ($org -eq ""){
$org = Read-Host "What is the Org name?"
}
while ($howmany -eq ""){
$howmany = Read-Host "Number of results?"
}
Get-ChildItem C:\ProgramData\JHA\Synergy\SynDocServer -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "$org" select -last "$howmany" }
- Edited by nucksin11 Tuesday, September 01, 2015 3:37 PM