How it works...

The [math]:: accelerator allows us to use the methods of the System.Math class. The Round() method accepts one or two arguments; in case of a single argument, the rounding happens to the nearest integer. The optional second parameter specifies the number of digits after the decimal point.

The Pow() method is almost self-explanatory: 10242 in our case. The Floor() method brought down numbers from 30.00 to less than 31, down to 30.

This is what we did:

  1. Listed out the files to delete: we subtracted the LastWriteTime from today, and performed a Floor operation on it since we were not allowed to use the -and operator.
  2. Displayed the files.
  3. We performed a remove operation on each of the files, while also adding the size of each of the files to $TotalFileSize.
  4. In the end, we divided $TotalFileSize by 10242 and rounded it off to the nearest MB.
..................Content has been hidden....................

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