en esta:
$volume = Get-Disk | Where Number -eq $disk |
New-Partition -UseMaximumSize -AssignDriveLetter |
Format-Volume -FileSystem FAT32
TIP: crear un pen USB booteable UEFI con Windows (cuando windows ocupa más del tamaño de un DVD). Ej: Server 2016
Colapsar
X
-
Hola Jm
he intentado el script....mira que curioso:
Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------ ----------------- ---------- ----------
3 SanDisk Ultra 4C531001340608115562 Healthy Online 57.84 GB GPT
Format-Volume : Size Not Supported
Activity ID: {3efd4550-3875-4d24-b46a-8847576c575e}
At D:\aa\aa.ps1:25 char:1
+ Format-Volume -FileSystem FAT32
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimException
+ FullyQualifiedErrorId : StorageWMI 4097,Format-Volume
You cannot call a method on a null-valued expression.
At D:\aa\aa.ps1:54 char:14
+ ParseName("$($volume.DriveLetter):").InvokeVerb('E ject')
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ( [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
subo una imagen que es mejor
Editado por última vez por barnastudios; 24/11/2018, 19:35:12.
Dejar un comentario:
-
-
Es importante que no perdáis esto de vista: cada vez las imágenes ocupan mas.
Dejar un comentario:
-
-
TIP: crear un pen USB booteable UEFI con Windows (cuando windows ocupa más del tamaño de un DVD). Ej: Server 2016
Una imagen de Windows "customizado", o bien incluso el Server 2016 que distribuye Microsoft, el install.win ocupa mas de 4 GB (el server 2016 ocupa 5,29 GB).
En este caso tenemos un problema: en un DVD normal no cabe. Y en un PEN, si lo queremos UEFI, debe ser FAT32, y el limite de un archivo (en este caso el install.wim) en FAT32 es 4 GB por lo cual no podremos tampoco crearlo.
Trampa: partir el fichero install.win en trozos inferiores a 4GB mediante la utilidad de Windows DISM.
El código powershell que dejo debajo, lo hace. (por favor, leer los comentarios en el codigo)
Código:# Tamaño minimo del pen USB stick 5.29GB # Poner aquí donde tenemos el ISO de W2016 $iso = 'C:\Users\localuser\Downloads\en_windows_server_2016_x64_dvd_9327751.iso' # Limpiar el USB. [COLOR=#FF0000][B]Poner en NN en la linea inferior el Numero de Disco del Pen que se ve en DISKPART[/B][/COLOR] # [U][B][COLOR=#FF0000]Ser cuidadoso con esto o borraremos un disco que no procede.[/COLOR][/B][/U] $disk=[SIZE=14px][B][COLOR=#FF0000]NN[/COLOR][/B][/SIZE] Get-Disk | Where Number -eq $disk | Clear-Disk -RemoveData -Confirm:$true -PassThru # Convertir a GPT if ((Get-Disk | Where Number -eq $disk).PartitionStyle -eq 'RAW') { Get-Disk | Where Numer -eq $disk | Initialize-Disk -PartitionStyle GPT } else { Get-Disk | Where Number -eq $disk | Set-Disk -PartitionStyle GPT } # Crear partition primaria y format a FAT32 $volume = Get-Disk | Where Number -eq $disk | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem FAT32 if (Test-Path -Path "$($volume.DriveLetter):\") { # Mount iso $miso = Mount-DiskImage -ImagePath $iso -StorageType ISO -PassThru # Driver letter $dl = ($miso | Get-Volume).DriveLetter } if (Test-Path -Path "$($dl):\sources\install.wim") { # Copiar ISO excepto el install.wim & (Get-Command "$($env:systemroot)\system32\robocopy.exe") @( "$($dl):\", "$($volume.DriveLetter):\" ,'/S','/R:0','/Z','/XF','install.wim','/NP' ) # Trocear el install.wim & (Get-Command "$($env:systemroot)\system32\dism.exe") @( '/split-image', "/imagefile:$($dl):\sources\install.wim", "/SWMFile:$($volume.DriveLetter):\sources\install.swm", '/FileSize:4096' ) } # Eject USB (New-Object -comObject Shell.Application).NameSpace(17). ParseName("$($volume.DriveLetter):").InvokeVerb('Eject') # Dismount ISO Dismount-DiskImage -ImagePath $iso
Etiquetas: Ninguno
-
👍 2
-
Dejar un comentario: