How can you get Info on all your Hard Drives Answer
Full-Access Members Only
Sorry, this lesson is only available to Server Academy Full-Access members. Become a Full-Access member now and get instant access to this and many more premium courses. Click the button below and get instant access now.
Instructions
Q&A (0)
Notes (0)
Resources (0)
Saving Progress...
Resources
There are no resources for this lesson.
Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.
Getting Hard drive Information
In this lecture I will show you how to access your local or remote systems hard drives including model numbers, Health status.
From the Host, open PowerShell ISE in admin mode:
Go ahead and copy and paste the Get-Disk command
Get-Disk | select model, HealthStatus
Here is the Explanation:
The PowerShell Get-Disk cmdlet is used to retrieve information about disks on a Windows system and the select cmdlet to display specific properties. Here's an explanation of each part:
Get-Disk: This cmdlet is used to retrieve information about disks (storage devices) connected to the computer. It returns a list of disk objects, each representing a physical disk or storage device.
| (Pipe Operator): The pipe operator is used to pass the output of one cmdlet as input to another cmdlet. In this case, it takes the output of Get-Disk and passes it to the next cmdlet, which is select.
select: This cmdlet is used to select and display specific properties of the objects in the input stream. In this case, it's used to select two properties: Model and HealthStatus.
Model: This property represents the model or type of the disk. It typically provides information about the manufacturer and the specific model of the disk. For example, it might display "Samsung SSD 850 EVO" for a Samsung solid-state drive.
HealthStatus: This property represents the health status of the disk. It indicates whether the disk is in a healthy or unhealthy state. The possible values for HealthStatus can include "Healthy," "Warning," "Unhealthy," or other similar states, depending on the disk's condition.
When you run this one-liner, it will retrieve information about all disks on the system and display only the Model and HealthStatus properties for each disk. This allows you to quickly check both the disk model and its health status for all disks in your computer.
Here is how you get a list of Hard drives, and also list the free space on each drive.
Copy and Paste the Get-WMIObject command
Get-WmiObject -Class Win32_LogicalDisk | Select-Object DeviceID, Size, FreeSpace
Here is the Explanation:
Get-WmiObject -Class Win32_LogicalDisk: This cmdlet retrieves information about logical disks on the computer using Windows Management Instrumentation (WMI). It queries the Win32_LogicalDisk class, which provides information about disks, including their drive letters and storage details.
Select-Object DeviceID, Size, FreeSpace: This cmdlet is used to select and display specific properties of the objects returned by Get-WmiObject. In this case, we are selecting three properties:
DeviceID: This property represents the drive letter of the logical disk, such as "C:", "D:", etc.
Size: This property represents the total size of the disk in bytes.
FreeSpace: This property represents the amount of free space available on the disk in bytes.
When you run this PowerShell command, it will retrieve information about all logical disks on your computer and display the drive letter (DeviceID), total size (Size), and free space (FreeSpace) for each disk.
Server Academy Members Only
Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.