ps/Modules/Alkami.PowerShell.SDK/Public/Get-HostsFileAllRecords.ps1

18 lines
572 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
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
}