function Get-HostToIP($hostname) {
$result = [system.Net.Dns]::GetHostByName($hostname)
$result.AddressList | ForEach-Object {$_.IPAddressToString }
}
Get-Content "D:\path.txt" | ForEach-Object {(Get-HostToIP($_)) + ($_).HostName >> d:\data\Addresses.txt}
$result = [system.Net.Dns]::GetHostByName($hostname)
$result.AddressList | ForEach-Object {$_.IPAddressToString }
}
Get-Content "D:\path.txt" | ForEach-Object {(Get-HostToIP($_)) + ($_).HostName >> d:\data\Addresses.txt}
No comments:
Post a Comment