Test Low Disk Space / Create Large Test File

So I stole this code from my friend Keith G, who provided it to assist with testing scenarios to see if our safe guards would work.
Basically, the 1 line command will check your drive, then create a dynamically sized file to leave “XX” GB remaining.  In my command, I leave only 15GB Free, which is low enough to trigger a failure on our in place upgrades.  Then I can test to make sure the the IPU TS fails the way I expect, running the proper remediation steps, and records the metrics for reporting.

Code: (run in elevated PowerShell Console)

So I made it into an App, I’ve added a few items into the app model to allow me to “install” it quickly on a machine to test failure scenarios.

App Code:

image

image

In action on Test Machine: Ran App, it created a 19GB File to get the HDD under 15GB Free

And now, my TS fails during Check Readiness, so I can make sure all of the metrics are being recorded.

One thought on “Test Low Disk Space / Create Large Test File

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.