diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fe5f28..c6555583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #489](https://github.com/dsccommunity/NetworkingDsc/issues/489). - Added support for publishing code coverage to `CodeCov.io` and Azure Pipelines - Fixes [Issue #491](https://github.com/dsccommunity/NetworkingDsc/issues/491). +- Minor change to environment variable lookup. ## [8.2.0] - 2020-10-16 diff --git a/source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 b/source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 index 279af660..89a8802a 100644 --- a/source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 +++ b/source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 @@ -222,7 +222,7 @@ function Get-HostEntry $HostName ) - $hostPath = "$env:windir\System32\drivers\etc\hosts" + $hostPath = "$env:SystemRoot\System32\drivers\etc\hosts" $allHosts = Get-Content -Path $hostPath | Where-Object -FilterScript { [System.String]::IsNullOrEmpty($_) -eq $false -and $_.StartsWith('#') -eq $false