This commit is contained in:
Madzone
2026-10-13 15:13:34 +02:00
parent 3bc149a3e6
commit c286614cfd
4 changed files with 98 additions and 50 deletions
+9 -6
View File
@@ -9,13 +9,16 @@ $script:checks=0
function Assert { param($Condition,$Message) if(-not $Condition){throw $Message}; $script:checks++ }
function Invoke-Command { param($ComputerName,$ScriptBlock,[object[]]$ArgumentList,$ErrorAction) & $ScriptBlock @ArgumentList }
function Test-Path { $true }
$priorSystemDrive=$env:SystemDrive
$env:SystemDrive='E:'
function New-CimSessionOption { param($Protocol,$ErrorAction) if($Protocol -ne 'Dcom'){throw 'Falsches Protokoll'}; 'DCOM' }
function New-CimSession { param($ComputerName,$SessionOption,$ErrorAction) $ComputerName }
function Get-CimInstance { [pscustomobject]@{SystemDrive='E:'} }
function Remove-CimSession { }
$script:ServerDestinationPaths=@{}
$script:DestinationPath=''
Assert ((Resolve-WindowsFolder 'server01') -eq 'E:\ndtrack') 'Systemlaufwerk E nicht verwendet'
$env:SystemDrive='D:'
Assert ((Resolve-WindowsFolder 'server02') -eq 'D:\ndtrack') 'Systemlaufwerk nicht pro Server aufgeloest'
$env:SystemDrive=$priorSystemDrive
Assert ((Resolve-WindowsFolder 'server01') -eq 'E:\ndtrack') 'Automatisches Systemlaufwerk falsch'
$script:ServerDestinationPaths=@{'server02'='E:\ndtrack'}
Assert ((Get-WindowsSharePath 'server02') -eq '\\server02\E$\ndtrack') 'Server-Ausnahme falsch'
$script:ServerDestinationPaths=@{}
$script:DestinationPath='D:\Tools\ndtrack'
Assert ((Resolve-WindowsFolder 'server01') -eq 'D:\Tools\ndtrack') 'Dynamischer Zielpfad falsch'
$rejected=$false