Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

new-partition but supress the dialog

$
0
0

hi, I want to initialize, partition, and format using PowerShell on windows Server 2012.

The following 3 lines  works, BUT the new-partition step opens a dialog "You need to format the disk in drive G: before you can use it" .

 I ran it from the PowerShell window and tried from PowerShell ISE, both opened with admin privilages.

How can I suppress that dialog?
maybe the issue is not my PowerShell but rather the Windows Server 2012 environment?

>>>>>>>>>>>>>>>>>>>

Initialize-Disk -Number 2 -PartitionStyle MBR -confirm:$false

New-Partition -DiskNumber 2 -UseMaximumSize -IsActive -DriveLetter z

Get-Partition -DiskNumber 2 -PartitionNumber 1 | Format-Volume -FileSystem NTFS -force -confirm:$false


-Craig (SQL Server User Education Team) // This posting is provided AS IS with no warranties, and confers no rights.



Viewing all articles
Browse latest Browse all 21975

Trending Articles



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