Monthly Archives: May 2017

Get-PhysicalDisk options

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 <CimInstance#MSFT_StorageEnclosure> -StorageNode <CimInstance#MSFT_StorageNode> -StoragePool <CimInstance#MSFT_StoragePool> -VirtualDisk <CimInstance#MSFT_VirtualDisk> When dealing with disks installed in the machine then the friendly … Continue reading

Posted in Powershell, Storage | Leave a comment

String casing

There are times when you may want to change string casing. You have a couple of options. There are a couple of methods on the string class that you can use to modify the case of a string. PS> ‘aaa’.ToUpper() … Continue reading

Posted in Powershell | 1 Comment

Build a better pull server

DSC functions in 2 modes – push (most basic) and pull. Creating a pull server is a non-trivial task and the out-of-the-box pull server has some issues. Some of the folks at powershell.org have decided its time to build a … Continue reading

Posted in DSC, Powershell | Leave a comment

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

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 … Continue reading

Posted in Powershell, Storage | Leave a comment

PowerShell in Azure Cloud Shell

if you are an Azure user see this post from the PowerShell team – https://blogs.msdn.microsoft.com/powershell/2017/05/23/coming-soon-powershell-in-azure-cloud-shell/

Posted in Azure, Powershell | Leave a comment

Diskpart and PowerShell – part4: Remove a partition

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 … Continue reading

Posted in Powershell, Storage | Leave a comment

Diskpart and PowerShell–part 4: 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 only uses part of the disk New-Partition -DiskNumber 1 -DriveLetter F … Continue reading

Posted in Powershell, Storage | Leave a comment