new-partition but supress the dialog


hi, want initialize, partition, , format using powershell on windows server 2012.

the following 3 lines  works, new-partition step opens dialog "you need format disk in drive g: before can use it" .

 i ran powershell window , tried powershell ise, both opened admin privilages.

how can suppress dialog?
maybe issue not powershell rather 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) // posting provided no warranties, , confers no rights.


hi craig,

i haven't tested this, try piping new-partition cmdlet out-null.

edit: looks out-null suppress console output, not explorer window.


don't retire technet!




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

difference between wuauclt1.exe and wuauclt.exe

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL