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)

get-volume c | % {$_.SizeRemaining - 15GB} |  % {Fsutil file createnew c:\TestFile.id $_}

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:

powershell.exe -command "get-volume c | % {$_.SizeRemaining - 15GB} |  % {Fsutil file createnew c:\TestFile.id $_}"

Read more