How to Clean Up PowerShell Script Variables without Restarting PowerShell ISE
Many times while authoring PowerShell scripts, the expected output will be incorrect because PowerShell ISE does not automatically cleanup it’s variable between manual runs of a script. In my experience this poses two practical issue which lead to incorrect script results: 1) If the variable is not explicitly re-initialized in