Advertisement
Guest User

Untitled

a guest
Jul 12th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. $Filepath = "C:inetpublogslogfilesW3SVC1"
  2. $Filen = Get-ChildItem -Path $Filepath | Select-Object -Last 1
  3. $Filename = ($Filen).FullName
  4. $Pat1 = "^.*(DocBOLAdviceConfirmListener).* (d{1,})$"
  5. #$Pat2 = "^.* (d{1,})$"
  6. #$data = ''
  7. $Count1 = 0
  8. $stream = New-Object System.IO.FileStream -ArgumentList $Filename, 'Open', 'Read', 'ReadWrite'
  9. $reader = New-Object System.IO.StreamReader -ArgumentList $stream, $true
  10. $reader.BaseStream.Seek(0, 'Begin')
  11. while (-not $reader.EndOfStream) {
  12. $line = $reader.ReadLine()
  13.  
  14. #$line
  15. if ([regex]::Matches($line,$Pat1,"IgnoreCase")) {
  16. $DocBolACLValue = $matches[2]
  17. if ($DocBolACLValue -gt 3000) {
  18. $Count1 += 1
  19. }
  20. }
  21. }
  22.  
  23. $reader.Close()
  24. $stream.Close()
  25. $Count1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement