HostFile.psm1
1 2 3 4 5 6 7 8 9 10 11 12 |
function Confirm-HostFileExist { $hostfilePath = "$env:SystemRoot\System32\Drivers\etc\hosts" $result = Test-Path -Path $hostfilePath if ($result) { Write-Output "Host file exist at $hostfilePath"; } else { Write-Output "Host file doesn't exist at $hostfilePath"; } } |