feat(RDPSign): opdatér Get-DesktopPaths til OneDrive Desktop

- Erstat Join-Path/Test-Path med Get-ChildItem -Filter "Desktop" -Depth 2
      så OneDrive-omdirigeret Desktop også fanges
    - Tilføj -Exclude "Public","Default" for at springe systemprofiler over
    - Anvendt i app/Install.ps1, Detect.ps1, Uninstall.ps1, SignOnly.ps1,
      SignOnly_detect.ps1, Clearsigning.ps1, sandbox.ps1
This commit is contained in:
GCH
2026-06-02 07:53:48 +02:00
parent ab2bb0735b
commit 9534e8f7d2
7 changed files with 21 additions and 28 deletions
+3 -5
View File
@@ -34,16 +34,14 @@ function Write-Log {
function Get-DesktopPaths {
if ($AllUsers) {
# Return desktop path for each user profile found
Get-ChildItem "$env:SystemDrive\Users" -Directory | ForEach-Object {
$path = Join-Path $_.FullName "Desktop"
if (Test-Path $path) { $path }
Get-ChildItem "$env:SystemDrive\Users" -Directory -Exclude "Public","Default" | ForEach-Object {
Get-ChildItem $_.FullName -Directory -Filter "Desktop" -Depth 2 -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty FullName
}
} else {
[Environment]::GetFolderPath("CommonDesktopDirectory")
}
}
try {
$desktopPaths = Get-DesktopPaths
Write-Log "Running in mode: $(if ($AllUsers) { 'All Users' } else { 'Public Desktop' })"