Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Filepath = "C:inetpublogslogfilesW3SVC1"
- $Filen = Get-ChildItem -Path $Filepath | Select-Object -Last 1
- $Filename = ($Filen).FullName
- $Pat1 = "^.*(DocBOLAdviceConfirmListener).* (d{1,})$"
- #$Pat2 = "^.* (d{1,})$"
- #$data = ''
- $Count1 = 0
- $stream = New-Object System.IO.FileStream -ArgumentList $Filename, 'Open', 'Read', 'ReadWrite'
- $reader = New-Object System.IO.StreamReader -ArgumentList $stream, $true
- $reader.BaseStream.Seek(0, 'Begin')
- while (-not $reader.EndOfStream) {
- $line = $reader.ReadLine()
- #$line
- if ([regex]::Matches($line,$Pat1,"IgnoreCase")) {
- $DocBolACLValue = $matches[2]
- if ($DocBolACLValue -gt 3000) {
- $Count1 += 1
- }
- }
- }
- $reader.Close()
- $stream.Close()
- $Count1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement