function Get-HostsFileAllRecords { <# .SYNOPSIS Returns all hosts file entries as a list of objects of the format: A list of records of the format @{ Keep = $false; IpAddress = $null; Hostname = $null; Comment = $null; BlankLine = $false; } .OUTPUTS A list of records of the format @{ Keep = $false; IpAddress = $null; Hostname = $null; Comment = $null; BlankLine = $false; } .LINK ConvertTo-HostsFileEntry #> [CmdletBinding()] [OutputType([object[]])] param() return (Get-Content -Path (Get-HostsFilePath)) | ConvertTo-HostsFileEntry }