Commit c9437b5
committed
Always restore old env variables
When we invoke the script block it could throw an exception so we should
wrap it in a try finally block to ensure that we can restore the old
environment variables, otherwise you can end up back in a shell that has
an incorrect set of variables set.
This is most noticable if an exception is thrown when entering the vs
dev shell since without resetting the old vars you will have invalid
Visual Studio env variables set meaning you need to manually reset your
shell environment.1 parent 3b18849 commit c9437b5
1 file changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 802 | + | |
| 803 | + | |
808 | 804 | | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
809 | 810 | | |
810 | | - | |
811 | | - | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
812 | 814 | | |
813 | 815 | | |
814 | 816 | | |
| |||
0 commit comments