Skip to content

Commit b2713e4

Browse files
committed
Add comment
1 parent a3184db commit b2713e4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

powershell-adapter/psDscAdapter/powershell.resource.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ switch ($Operation) {
9191
# TODO: for perf, it is better to take capabilities from psd1 in Invoke-DscCacheRefresh, not by extra call to Get-Module
9292
if ($DscResourceInfo.ModuleName) {
9393
$module = Get-Module -Name $DscResourceInfo.ModuleName -ListAvailable | Sort-Object -Property Version -Descending | Select-Object -First 1
94+
# If the DscResourceInfo does have capabilities, use them or else use the module's capabilities
9495
if ($DscResourceInfo.Capabilities) {
9596
$capabilities = $DscResourceInfo.Capabilities
9697
} elseif ($module.PrivateData.PSData.DscCapabilities) {

powershell-adapter/psDscAdapter/psDscAdapter.psm1

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

327327
# fill in resource files (and their last-write-times) that will be used for up-do-date checks
328328
$lastWriteTimes = @{}
329-
Get-ChildItem -Recurse -File -Path $dscResource.ParentPath -Include "*.ps1", "*.psd1", "*.psm1", "*.mof" -ea Ignore | % {
329+
Get-ChildItem -Recurse -File -Path $dscResource.ParentPath -Include "*.ps1", "*.psd1", "*.psm1", "*.mof" -ea Ignore | ForEach-Object {
330330
$lastWriteTimes.Add($_.FullName, $_.LastWriteTime)
331331
}
332332

@@ -339,7 +339,7 @@ function Invoke-DscCacheRefresh {
339339

340340
[dscResourceCache]$cache = [dscResourceCache]::new()
341341
$cache.ResourceCache = $dscResourceCacheEntries
342-
$m = $env:PSModulePath -split [IO.Path]::PathSeparator | % { Get-ChildItem -Directory -Path $_ -Depth 1 -ea SilentlyContinue }
342+
$m = $env:PSModulePath -split [IO.Path]::PathSeparator | ForEach-Object { Get-ChildItem -Directory -Path $_ -Depth 1 -ea SilentlyContinue }
343343
$cache.PSModulePaths = $m.FullName
344344
$cache.CacheSchemaVersion = $script:CurrentCacheSchemaVersion
345345

0 commit comments

Comments
 (0)