This script is designed to search through legislative/regulatory XML files from the Department of Justice Laws website for a given set of search terms and pass back a CSV formatted output like in the form:
Title of Legislation
, Legislative Provision Reference
, Search Term Found
To search the Income Tax Regulations for the term "remuneration" you download the Income Tax Regulations XML and set
$xmlFileList = Get-ChildItem "/path/to/file.xml"
and set the search term:
$searchterm = "remuneration"
When you run, the script will the following information for every occurence of the search term within the XML file or files you are searching.
The format of the output is comma separated values like"
Title of Legislation
, Legislative Provision Reference
, Search Term Found
You can also search for multiple search terms and multiple files. For example, to search all downloaded XML files for "permit" and "licence" you download the XML files for every act or regulation you want to search and then change
$xmlFileList = Get-ChildItem "/path/to/*.xml"
and set the search term:
$searchterm = "permit", "licence