Quantcast
Channel: Setup Deployment forum
Viewing all articles
Browse latest Browse all 2818

Initialize-Disk : The disk has already been initialized.

$
0
0

Hello everyone

I asked this question in powershell forum but nobody gave me an answer I'm tryingto create a tool that will create a bootable UEFI  USB for windows 10this is my command

$removabledrive = Get-WmiObject Win32_diskdrive | Where-Object interfacetype -EQ usb | Select-Object caption -ExpandProperty caption
[char]$freeletter = get-wmiobject win32_logicaldisk | select -expand DeviceID -Last 1 | % { [char]([int][char]$_[0] + 1) }

Clear-Disk -FriendlyName $removabledrive -RemoveData
Initialize-Disk -FriendlyName $removabledrive –PartitionStyle GPT
New-Partition -DiskNumber $disknumber -UseMaximumSize -IsActive:$true -DriveLetter $freeletter

I receive error that the disk has already been initialize. I need to initialize it as GPT as for my little knowlege allows me to make it UEFI bootable correct me if I'm wrong or there is another method

thanks for all


Viewing all articles
Browse latest Browse all 2818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>