File Length Needing to be displayed as either MB or GB in code

Welcome Forums General PowerShell Q&A File Length Needing to be displayed as either MB or GB in code

Viewing 1 reply thread
  • Author
    Posts
    • #261602
      Participant
      Topics: 13
      Replies: 40
      Points: 177
      Rank: Participant

      probably a real easy one here to answer:.

       

      I am displaying a file size in a table that is very large.

       

      I need the code for how to display that same number in the Length column in either MB or GB.

       

      Please advise.

       

      Thank you

    • #261605
      Participant
      Topics: 8
      Replies: 617
      Points: 2,393
      Helping Hand
      Rank: Community Hero

      Typically we help you with code that you’ve written that you’re having issues with. However you are in luck as I recently answered a question on Stackoverflow where the user needed to do the same thing with very large numbers.

      Call the function and pass in your number and it will return the formatted size. You may need to adjust this if you really only want MB or GB.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.