We can view today's iis logs in grid view mode using below ps script. ```sh $IISLogs ="C:\\InetPub\\Logs\\LogFiles\\W3SVC1\\" $Today=$(Get-Date -F 'yyMMdd') Function Out-GridViewIISLog ($File) { $Headers = @((Get-Content -Path $File -ReadCount 4 -TotalCount 4)[3].split(' ') | Where-Object { $_ -ne '#Fields:' }); Import-Csv -Delimiter ' ' -Header $Headers -Path $File | Where-Object { $_.date -notlike '#*' } | Out-GridView -Title "IIS log: $File"; }; Out-GridViewIISLog -File $(Join-path $IISLogs "u_ex.$Today.log") ```
Azure Cloud Solution Architect, Full-Stack Development in .Net Eco system, Senior Manager at Capgemini
Tuesday, July 18, 2023
View IIS logs in grid view mode
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment