How to convert bytes to KB MB GB TB or PT in PowerShell

Problem:

How do I convert bytes to KB MB GB TB or PT in PowerShell?

Solution:

You can use the below to make calculations to get various data sizes

$size = 16000865005568
$size / 1KB
$size / 1MB
$size / 1GB
$size / 1TB
$size / 1PB  

 

Leave a Reply

Your email address will not be published. Required fields are marked *