fix (maybe?)

This commit is contained in:
MyDrift 2024-08-19 22:16:39 +02:00
parent ea2a92fb1e
commit fcd339d54d
2 changed files with 7 additions and 3 deletions

View File

@ -248,7 +248,7 @@ function Remove-FileOrDirectory([string]$pathToDelete, [string]$mask = "", [swit
function New-Unattend {
param (
[Parameter(Mandatory, Position = 0)] [string] $userName,
[Parameter(Mandatory, Position = 0)] [string]$userName,
[Parameter(Position = 1)] [string] $userPassword
)

View File

@ -80,14 +80,18 @@ function Invoke-WPFGetIso {
# Auto download newest ISO
# Credit: https://github.com/pbatard/Fido
$fidopath = "$env:temp\Fido.ps1"
$originalLocation = Get-Location
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
$selectedItem = ($sync["ISOArchitecture"].SelectedItem -split '-')[0]
$rel = "x" + $selectedItem
# Have to correct the language to actually be a working one
# TODO: Have to correct the language to actually be a working one
Set-Location -Path $env:temp
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch $rel
$filePath = "$workingdir\*.iso"
Set-Location $originalLocation
$filePath = Get-ChildItem -Path "$env:temp" -Filter "Win11*.iso" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
}
Write-Host "File path $($filePath)"