Fix Progress Preference variable in adv functions by cmkb3 · Pull Request #24591 · PowerShell/PowerShell
@cmkb3 Sorry it took so long to review this PR!
The fix looks good, but I pushed a commit for 2 minor changes:
- Move the assertions to the static constructor of
Compiler. This is whereAutomaticVariableTypesandPreferenceVariableTypesget used, and more importantly, this code path will always be hit, so if they are out of sync, we will know immediately. - Update the tests a little -- a)
$psis created before eachIttest and disposed afterwards, so the newly added tests should not create new PowerShell instances. b) also add a parameter in the 2nd test case.