"Elle", c'est "il"

-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
Un ordinateur qui n'est pas compatible x64, ça n'existe plus.
-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
J'ai oublié de répondre à ton message que je ne vois que maintenant.
La rousse de mon avatar, c'est… Lara Croft !
-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
Code : Tout sélectionner
#-----------------------------------------------------------
# Création d'une clé USB pour installation de Windows 10
# selon la méthode ThiWeb
#-----------------------------------------------------------
Function Select-FileDialog
# Created by Hugo Peeters #
# http://www.peetersonline.nl #
{
param([string]$Title,[string]$Directory,[string]$Filter="All Files (*.*)|*.*")
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$objForm = New-Object System.Windows.Forms.OpenFileDialog
$objForm.InitialDirectory = $Directory
$objForm.Filter = $Filter
$objForm.Title = $Title
$objForm.Multiselect = $false
$Show = $objForm.ShowDialog()
If ($Show -eq "OK") {Return $objForm.FileName} Else{Return ""}
}
Function Byebye{
Write-host `n"Fin du script"`n -ForegroundColor DarkCyan
Read-host -Prompt "Pressez sur Entrée pour Quitter "
Exit
}
CLS
# Vérification si PowerShell en mode administrateur ?
If (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
write-host `n"Ce script doit être lancé en mode administrateur" -ForegroundColor Magenta
Byebye
}
write-host "Disque(s) de 8 à 64 Go connecté(s) aux ports USB de l'ordinateur :"
$diskusb = Get-Disk | Where-Object -FilterScript {($_.Bustype -Eq "USB") -and (($_.Size -lt 64000000000) -and ($_.size -gt 7000000000))}
if (!$diskusb) {
Write-host `n"Aucun" -ForegroundColor Red
Byebye
}
$diskusb | format-table @{name="Numéro";expression={$_.Number}}, @{name="Nom ";expression={$_.friendlyname}}, @{name="Taille (GB)";Expression={[math]::round($_.size/1GB,2)}}
$retour = read-host -Prompt "Entrez le numéro du disque USB à traiter ou n'importe quoi pour Quitter "
if ($diskusb.number -notcontains $retour) {Byebye}
$cleusb = get-disk | where-object {$_.number -eq $retour}
write-host `n"!!! Attention, tout ce que contient ce disque sera définitivement effacé !!! " -ForegroundColor red
write-host "Disque n°"$cleusb.number" - "$cleusb.friendlyname" - "([math]::round($cleusb.size/1GB,2))"GB" -ForegroundColor Gray
$clavier = read-host -Prompt "Entrez [Oui] pour Confirmer ou n'importe quoi pour Quitter"
if ($clavier -cne "Oui"){
write-host `n"La clé n'a pas été modifiée."
Byebye}
write-host `n"Sélectionnez l'iso d'installation de Windows dans la boîte de dialogue ou Annuler pour Quitter."
$file = Select-FileDialog -Title "Choisissez un fichier d'installation .iso" -Filter "Fichiers (*.iso)|*.iso"
if ($file -notlike "*.iso"){
write-host `n"La clé n'a pas été modifiée."
Byebye}
write-host $file -ForegroundColor Gray
write-host `n`n"Début du traitement de la clé USB"`n
$vol1 = get-disk -number $retour | clear-disk -RemoveData -RemoveOEM -Confirm:$false -Passthru |
new-partition -mbrtype FAT32 -size 1024MB -IsActive -AssignDriveLetter |
format-volume -FileSystem FAT32 -NewFileSystemLabel Boot -Confirm:$false
write-host "Contenu de la clé effacé"
$path1 = $vol1.DriveLetter + ":\"
$i="{0:N2}" -f $($vol1.size /1GB)
write-host "Partition" $vol1.FileSystemLabel " créée" ("("+$path1.substring(0,2)+")")$i Go $vol1.filesystem
$vol2 = new-partition -disknumber $retour -UseMaximumSize -IsActive -AssignDriveLetter | format-volume -FileSystem NTFS -NewFileSystemLabel INSTALL -Confirm:$false
$path2 = $vol2.DriveLetter + ":\"
$i="{0:N2}" -f $($vol2.size /1GB)
write-host "Partition" $vol2.FileSystemLabel "créée"("("+$path2.substring(0,2)+")")$i Go $vol2.filesystem
#--------- Recopie des fichiers ---------------------------------------------------
$pathiso = (Mount-DiskImage -ImagePath $file -StorageType ISO -PassThru | Get-Volume).DriveLetter + ":\"
write-host `n"Disque virtuel monté" ("("+$pathiso.substring(0,2)+")")
if (Copy-Item -path ($pathiso + "bootmgr.efi") -destination $path1 -PassThru){write-host "Fichier Bootmgr.efi copié"}
if (Copy-Item -path ($pathiso + "bootmgr") -destination $path1 -PassThru) {write-host "Fichier Bootmgr copié"}
if (Copy-Item -path ($pathiso + "boot") -destination $path1 -recurse -PassThru){write-host "Dossier boot copié"}
if (Copy-Item -path ($pathiso + "efi") -destination $path1 -recurse -PassThru){write-host "Dossier efi copié"}
if (New-Item -Path $path1 -name "sources" -itemtype "directory"){write-host "Dossier SOURCES créé"}
if (Copy-Item -path ($pathiso + "sources\boot.wim") -destination ($path1 + "sources") -PassThru){write-host "Fichier boot.wim copié"}
write-host "Recopie du contenu de l'iso, patientez plusieurs minutes."
if (Copy-Item -path ($pathiso.replace("\","*")) -destination $path2 -recurse -Passthru) {write-host "Contenu de l'iso recopié dans Install"}
if (Dismount-DiskImage -ImagePath $file){write-host "Disque virtuel démonté"}
write-host `n"Traitement terminé, la clé est prête."`n -ForegroundColor Green
Read-host -Prompt "Pressez sur Entrée pour Quitter"
MDR
OS : W11 Pro version 22H2
Navi : Firefox
Photos : Canon EOS 5D MARK III + Zoom CANON 70-200 L USM
Impr : HP Officejet Pro plus 8600
Proc : Intel i9-13900 (3.0 GHz/5.8 GHz)
Boitier : Phanteks Enthoo Elite
CM : Asus ROG SRIX Z790-E GAMING WIFI
CG : Gainwad GeoForce RTX 4070 Ti Phanter
-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
@ LaDidi21
-> Décryptage des liens du forum : extension "ThiWeb Crypt / Decrypt"™ ou Thiweb Live <-
Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 1 invité