Large byte values

PowerShell provides operators for working with bytes. These operators are as follows:

  • nKB: Kilobytes (n * 10241)
  • nMB: Megabytes (n * 10242)
  • nGB: Gigabytes (n * 10243)
  • nTB: Terabytes (n * 10244)
  • nPB: Petabytes (n * 10245)

These operators can be used to represent large values:

PS> 22.5GB
24159191040

The operators may also be used to convert large byte values into shorter values. For example, a shorter value might be added to a message using the format operator, as shown here:

PS> '{0:F} TB available' -f (123156235234522 / 1TB) 
112.01 TB available
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.105.105