Get the free space and total size of each drive in gigabytes using PowerShell

To accurately get the free space and total size of each drive in gigabytes using PowerShell, you can modify the previous command slightly. Here’s a corrected version that ensures the free space and total size are displayed properly:

Get-PSDrive -PSProvider FileSystem | Format-Table Name, Used, Free, @{n="TotalSize(GB)";e={[math]::Round(($_.Used + $_.Free) / 1GB, 2)}}, @{n="FreeSpace(GB)";e={[math]::Round($_.Free / 1GB, 2)}}
  • free space and total size of each drive in gigabytes using Power, free space, total size of each drive
  • 0 أعضاء وجدوا هذه المقالة مفيدة
هل كانت المقالة مفيدة ؟

مقالات مشابهة

Script to Calculate Folder Sizes PowerShell

$volumePath = "C:\" # Replace this with the path of the volume root you want to analyze # Get...

.ps1 cannot be loaded because the execution of scripts is disabled on this system

  We need to run the following command: Set-ExecutionPolicy -scope CurrentUser Unrestricted

check for local userif that exists, reset the password and add it to the local administrators group if it does not exist. Create and enable it,

script to check for local user "ITAdmin" if that exists, reset the password and add it to the...