From 2b826f1ff281bb35afc2f4bc8446453654ee66a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Harjam=C3=A4ki?= Date: Mon, 6 Jul 2026 19:54:14 +0300 Subject: [PATCH] fix: add -Force to Get-ChildItem in tree digest/copy to include hidden files in scope checks --- scripts/Cas.Workstation.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Cas.Workstation.psm1 b/scripts/Cas.Workstation.psm1 index 8adabba..2069887 100644 --- a/scripts/Cas.Workstation.psm1 +++ b/scripts/Cas.Workstation.psm1 @@ -1,4 +1,4 @@ -Set-StrictMode -Version Latest +Set-StrictMode -Version Latest function Get-CasModuleRoot { Split-Path -Parent $PSScriptRoot @@ -1191,7 +1191,7 @@ function Get-CasTreeDigest { return $null } $entries = @( - Get-ChildItem -LiteralPath $root -Recurse -File | Sort-Object FullName | ForEach-Object { + Get-ChildItem -LiteralPath $root -Recurse -File -Force | Sort-Object FullName | ForEach-Object { $null = Assert-CasSafePath -Path $_.FullName -ApprovedRoots $root [ordered]@{ path = $_.FullName.Substring($root.Length).TrimStart("\", "/").Replace("\", "/") @@ -1230,7 +1230,7 @@ function Copy-CasManagedTree { Remove-Item -LiteralPath $targetRoot -Recurse -Force New-Item -ItemType Directory -Path $targetRoot -Force | Out-Null } - foreach ($file in Get-ChildItem -LiteralPath $sourceRoot -Recurse -File) { + foreach ($file in Get-ChildItem -LiteralPath $sourceRoot -Recurse -File -Force) { $null = Assert-CasSafePath -Path $file.FullName -ApprovedRoots $sourceRoot $relative = $file.FullName.Substring($sourceRoot.Length).TrimStart("\", "/") $destination = Join-Path $targetRoot $relative