PowerShell for Windows Admins:

Disk storage

1

July 12, 2017  10:13 AM

More diskinfo

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Disk storage, Powershell

Yesterday I showed how to get the disk, partition and logical disk information using CIM. Today I want to show more diskinfo techniques. This time we’ll use the Storage module which was introduced with Windows 8. Underneath the covers it uses CIM – just different classes. The storage module...

July 11, 2017  12:35 PM

Linking disks, partitions and logical drives

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Disk storage, Powershell, WMI

A question of the forums was asking about discovering disk information. They were trying to pipe the output of Get-WmiObject into another Get-WmiObject. that won’t work. There is another way. On Windows machines physical drives are divided into 1 or more partitions which are each divided into one...


May 31, 2017  4:42 PM

Get-PhysicalDisk options

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

These are the Get-PhysicalDisk options for identifying the disk you want -UniqueId <string> -ObjectId <string> -FriendlyName <string> -InputObject <CimInstance#MSFT_PhysicalDisk> -StorageSubsystem <CimInstance#MSFT_StorageSubsystem> -StorageEnclosure...


May 26, 2017  8:53 AM

Diskpart and PowerShell – part 6: Multiple partitions on a disk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far we’ve looked at creating a single partition on a disk. This time we’ll look at how you can create multiple partitions on a disk. The are good reasons not to do this but its something I’ve seen done on a frequent basis. Lets create a 20GB disk as an example and mount it

New-VHD...


May 22, 2017  1:11 PM

Diskpart and PowerShell – part4: Remove a partition

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far you’ve seen how to create and modify partitions and volumes. Its now time to look at how you remove a partition. Mount the test VHD

Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
You can’t remove a volume – you have to remove the partition. Identifying the CORRECT...


May 21, 2017  1:50 PM

Diskpart and PowerShell–part 4: Expand a volume

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

You've seen how to create a volume but how do you expand a volume? Let’s create a new disk and mount it

New-VHD -Path C:\test\Test1.vhdx -Dynamic -SizeBytes 20GB
Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
Initialize-Disk -Number 1
This time we’ll create a volume that...


April 28, 2017  1:20 PM

Diskpart and PowerShell–part 3: Initialize disk and create volume

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

Last time we created a virtual disk and mounted it. In this post we’ll initialize the disk and create a volume. Start by remounting the disk Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD You can now initialize the disk: Initialize-Disk -Number 1 Create a partition: New-Partition...


April 27, 2017  1:44 PM

Diskpart and PowerShell–part 2: Create a virtual disk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

Before we start digging into the diskpart/Storage module functionality we need a disk to practice on. I don’t recommend using your machine’s system disk – bad things will happen. The Hyper-V module has  a New-VHD cmdlet so lets use that to create a disk to play with. The great thing...


April 26, 2017  1:41 PM

DiskPart and PowerShell–part 1

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Disk storage, Powershell

An attendee at the Summit made the statement that the DiskPart utility didn’t have any equivalent in PowerShell. That’s not strictly true as the storage module provides a lot of functionality that maps to diskpart functionality. The module contents include: PS> Get-Command -Module...


1

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: