Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Expand Disk using Powershell

$
0
0

Hello,

i would like to resize my Windows Server 2012 R2 using Powershell.

I have only one Disk with 72 GB and want to expand it to 100 GB so i got 28 GB unallocated storage.

Thats what i tried (Powershell beginner/noob):


get-disk

then i know my Total Size (even with the unallocated storage)

and now i tried to get the Total Size with:

get-disk | $size = TotalSize - did not work
get-disk | $size = $size.TotalSize - did not work


after this step i would like to go:

Resize-Partition -Disknumber 0 -PartitionNumber 2 -Size $size

Any Ideas on how to do it better or how i can get the TotalSize as $size....
Its my C: so its Disk 0 and because of System reserved its PartitionNumber 2 just for your information


Also i cant get the unallocated Storage with(it just doesnt showes up:

get-partition -disknumber 0


I hope you guys can help me....

Marc


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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