I’ve been running our builds with psake, and have found that I get errors if I try to run a build script twice in the same Powershell session. I looked around a bit about how to reset your Powershell environment without closing and reopening a Powershell console window, but couldn’t find anything.
Here’s what I came up with that works for me.
Remove-Variable * -ErrorAction SilentlyContinue; Remove-Module *; $error.Clear(); Clear-Host
And now, the short version:
rv * -ea SilentlyContinue; rmo *; $error.Clear(); cls