(view source code of disks.ps as plain text)
param(
[parameter( ValueFromRemainingArguments = $true )]
[string[]]$Args # Leave all argument validation to the script, not to PowerShell
)######### Help #########if ( ( $Args.Length -gt 0 ) -or ( $HOME[0] -eq '/' ) ) {
Clear-Host Write-Hostif ( $HOME[0] -eq '/' ) {
# LinuxWrite-Host "Disks.ps1 is for Windows only"
Write-Host }Write-Host "Disks.ps1, Version 1.00"
Write-Host "List physical harddisks and their manufacturer, model, size, bus type, physical location and more"
Write-HostWrite-Host "Usage: " -NoNewline
Write-Host "powershell . Disks.ps1" -ForegroundColor White
Write-HostWrite-Host "Notes: This script does " -NoNewline
Write-Host "not" -NoNewline -ForegroundColor White
Write-Host " require elevated privileges."
Write-HostWrite-Host "Credits: Sorting by device ID based on tip by Frode F"
Write-Host " https://stackoverflow.com/a/15040557" -ForegroundColor DarkGray
Write-Host Write-HostWrite-Host "Written by Rob van der Woude"
Write-Host "http://www.robvanderwoude.com"
Write-Host exit 1}Get-PhysicalDisk | Select BusType,DeviceID,FirmwareVersion,Manufacturer,MediaType,Model,PhysicalLocation,SerialNumber,Size | Sort-Object { [int]$_.DeviceID }
page last modified: 2025-10-11; loaded in 0.0089 seconds