Skip to content

Commit 59461e5

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
use -literalpath
1 parent fecc0f5 commit 59461e5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

adapters/powershell/psDscAdapter/powershell.resource.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ $ps = [PowerShell]::Create().AddScript({
104104

105105
# Adding some debug info to STDERR
106106
Write-Debug -Debug ('PSVersion=' + $PSVersionTable.PSVersion.ToString())
107-
Write-Debug -Debug ('PSPath=' + $PSHome)
107+
Write-Debug -Debug ('PSHome=' + $PSHome)
108108
Write-Debug -Debug ('PSModulePath=' + $env:PSModulePath)
109109

110110
if ($PSVersionTable.PSVersion.Major -le 5) {

adapters/powershell/psDscAdapter/psDscAdapter.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function Invoke-DscCacheRefresh {
348348

349349
# fill in resource files (and their last-write-times) that will be used for up-do-date checks
350350
$lastWriteTimes = @{}
351-
Get-ChildItem -Recurse -File -Path $dscResource.ParentPath -Include "*.ps1", "*.psd1", "*.psm1", "*.mof" -ErrorAction Ignore | ForEach-Object {
351+
Get-ChildItem -Recurse -File -LiteralPath $dscResource.ParentPath -Include "*.ps1", "*.psd1", "*.psm1", "*.mof" -ErrorAction Ignore | ForEach-Object {
352352
$lastWriteTimes.Add($_.FullName, $_.LastWriteTime)
353353
}
354354

@@ -361,7 +361,7 @@ function Invoke-DscCacheRefresh {
361361

362362
[dscResourceCache]$cache = [dscResourceCache]::new()
363363
$cache.ResourceCache = $dscResourceCacheEntries
364-
$m = $env:PSModulePath -split [IO.Path]::PathSeparator | ForEach-Object { Get-ChildItem -Directory -Path $_ -Depth 1 -ErrorAction Ignore }
364+
$m = $env:PSModulePath -split [IO.Path]::PathSeparator | ForEach-Object { Get-ChildItem -Directory -LiteralPath $_ -Depth 1 -ErrorAction Ignore }
365365
$cache.PSModulePaths = $m.FullName
366366
$cache.CacheSchemaVersion = $script:CurrentCacheSchemaVersion
367367

0 commit comments

Comments
 (0)