Welcome to the PowerShell: Do I.T. Yourself! - Diagnostics. Check you hard drive health, memory, CPU and other fun settings with PowerShell. Enjoy!

The Download

Download the diagnostics.zip code HERE.

How To

1) Click the link to download the ZIP file.
2) Right click the file and extract the contents.
3) Right click on the PS1 file and select "Run With PowerShell".
4) Enter Yes if prompted to run the script.
5) View the output of each section.
 
OR watch the video below and follow along.

The Code

$computerSystem = Get-CimInstance CIM_ComputerSystem;
$computerOS = Get-CimInstance CIM_OperatingSystem;
$computerCPU = Get-CimInstance CIM_Processor;
$harddisk = Get-PhysicalDisk | select DeviceId, Model, MediaType, HealthStatus, @{n="Size";e={[math]::Round($_.Size/1GB,2)}};
$memory = wmic MEMORYCHIP get Capacity,Speed;
$cpuSpeed = Get-CimInstance Win32_Processor | Select-Object -Expand MaxClockSpeed;
$videoDisplay = Get-CimInstance -ClassName CIM_Display;
$workstationUptime = wmic path Win32_OperatingSystem get LastBootUpTime;
$Today = (Get-Date).DateTime;
Write-Output "Date: "$today;
Write-Output "System: "$computerSystem;
Write-Output "OS: "$computerOS;
Write-Output "CPU: "$computerCPU;
Write-Output "CPU Speed (MHz): "$cpuSpeed;
Write-Output "Hard Drive: "$harddisk;
Write-Output "Memory Capacity: "$memory;
Write-Output "Video Display: "$videoDisplay;
Write-Output "Workstation Uptime: "$workstationUptime;

Output Explained


System, OS & CPU
  1) Date and Time
  2) System Name, User, Domain / Workgroup, Memory and System information.
  3) Windows Build and version information.
  4) CPU model and information.

CPU Speed & Hard Drive
  1) CPU Max Clock Speed
  2) Hard Drive Health
  3) SD Hard Drive Health

Memory & Video
  1) Memory Capacity and speed per slot
  2) Video and display information
Uptime
  1) 2021/08/14 12:05:27 or 12:05:27 on 08/14/2021 was the last reboot date and time.

Conclusion

There you go! The next step is checking the operating system, memory, hard drive and other information to see if there is a problem and we can go from there.