# encoding: ascii # api: powershell # title: # description: This newer version of the ExBPA only creates HTML based reports for each server. This setup made the reports difficult to compile and notarize. So I made a parser to read the HTML and convert the pertinent data into CSV files. # version: 0.1 # type: script # author: Josh Wortz # license: CC0 # x-poshcode-id: 5768 # x-archived: 2015-03-23T13:08:48 # # <# .SYNOPSIS Converts Microsoft Office 365 Best Practices Analyzer HTML reports to CSV. .DESCRIPTION Converts Microsoft Office 365 Best Practices Analyzer HTML reports to CSV. .PARAMETER FileLocation Provide the path to one or many HTML files. .EXAMPLE ConvertExBPATo-CSV -FileLocation (Get-ChildItem *.html) .NOTES Author: Josh Wortz Date Created: 3/3/2015 #> param( [ValidateScript({%{Test-Path $_ -PathType 'Leaf'}})][string[]]$FileLocation ) function ParseBPA([ValidateScript({%{Test-Path $_ -PathType 'Leaf'}})][string[]]$Files) { $detailsRegx = "]*>(.*?)

" $notesRegx = "]*\/>(.*?)
" [array]$HTMLArray = ([string](Get-Content $Files)).replace("