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

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Event ID 64,77,1008 Certificates Events Windows Server 2008, 2008R2