I often collapse long functions while writing scripts in PowerShell ISE. However, if I introduce a syntax error while editing the script above a collapsed function, PowerShell ISE expands all of the functions below the syntax error.
How can I prevent ISE from expanding the functions?
Everything is fine before I assign a value to my new variable:
I temporarily cause a syntax error when assigning my value, causing ISE to expand all of the collapsed functions below: