When you create PowerShell WPF code inside the ISE Editor and run it, you may occasionally experience crashs or out-of-memory errors that surface as “Out of Quota” Messages.
One easy way to work around is to not run your WPF script in the ISE context. So rather than hitting the green execution button or press F5, use the ISESteroids test functionality:
To execute any script in a new default PowerShell console, click the toolbar button with the blue PowerShell icon in the main toolbar menu.
This runs your code in a completely new and fresh PowerShell console environment. When you right-click the button, you can even set special test scenarios.