Execution Flow
Synopsis
Traverses the WMI CIM class association chain to determine which drive letters belong to each physical disk. This is the only reliable way to detect that, for example, D: and E: reside on the same physical LUN on a SAN — a configuration where a single disk extension would affect both volumes. Remote queries use CIM/DCOM and do not require WinRM.
-SqlInstance or -ServerName instead of -ComputerName when working within the sqmSQLTool pipeline.Syntax
Get-sqmDiskPartitionMap [-ComputerName <String[]>] # pipeline; aliases: SqlInstance, ServerName [-NoClipboard] [-EnableException]
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| -ComputerName | String[] | $env:COMPUTERNAME | Target computer(s). Pipeline-capable. Also accepts -SqlInstance and -ServerName as aliases. |
| -NoClipboard | Switch | false | Suppress copying the result to the clipboard. |
| -EnableException | Switch | false | Throw terminating exceptions. |
Return Value
Array of [PSCustomObject] — one entry per physical disk per computer:
| Property | Description |
|---|---|
| ComputerName | Source computer. |
| DiskIndex | Physical disk index (Win32_DiskDrive.Index). |
| Model | Disk model string. |
| SerialNumber | Physical disk serial number. |
| SizeGB | Total disk size in GB. |
| PartitionCount | Number of partitions on this disk. |
| DriveLetters | Array of drive letters on this disk (e.g. ["D","E"]). |
| IsShared | Boolean — true if more than one drive letter is on this physical disk. |
| MediaType | Fixed / Removable / Unknown. |
| InterfaceType | SCSI / IDE / USB / etc. |
Examples
# Map all physical disks on the local machine Get-sqmDiskPartitionMap # Show shared disks only Get-sqmDiskPartitionMap | Where-Object IsShared # Remote query via CIM/DCOM (no WinRM needed) Get-sqmDiskPartitionMap -ComputerName "SQL01","SQL02" # Pipeline from SqlInstance alias "SQL01","SQL02" | Get-sqmDiskPartitionMap -NoClipboard