# Parameter $excelPath = "C:\Pfad\zu\hosts.xlsx" $isoPath = "C:\Pfad\zu\original.iso" $tempPath = "C:\Temp\IsoContents" $newIsoPath = "C:\Pfad\zu\custom.iso" # Import-Excel Modul laden Import-Module ImportExcel # Excel-Daten lesen $hostsData = Import-Excel -Path $excelPath # ISO mounten und Dateien kopieren Mount-DiskImage -ImagePath $isoPath $disk = Get-DiskImage -ImagePath $isoPath $volume = Get-Volume -DiskImage $disk Copy-Item -Path "$($volume.DriveLetter):\*" -Destination $tempPath -Recurse Dismount-DiskImage -ImagePath $isoPath # ks.cfg aktualisieren $ksPath = "$tempPath\ks.cfg" $configContent = Get-Content -Path $ksPath foreach ($host in $hostsData) { $hostname = $host.Hostname $ip = $host.'IP-Adresse' $netmask = $host.Netzmaske $gateway = $host.Gateway $dns = $host.'DNS-Server' $username = $host.Benutzername $password = $host.Passwort $timezone = $host.Zeitzone $partitioning = $host.Partitionierung $configContent = $configContent -replace "", $hostname $configContent = $configContent -replace "", $ip $configContent = $configContent -replace "", $netmask $configContent = $configContent -replace "", $gateway $configContent = $configContent -replace "", $dns $configContent = $configContent -replace "", $password $configContent = $configContent -replace "", $timezone $configContent = $configContent -replace "", $partitioning } $configContent | Set-Content -Path $ksPath # Neue ISO erstellen & oscdimg -n -m -b"$tempPath\boot\etfsboot.com" $tempPath $newIsoPath Write-Host "Neue ISO wurde erstellt: $newIsoPath"