windows: Add support for fetching shell environment in remote projects (#39831)

Closes #39216

Note that this affects all platforms, I'm just using the prefix to make
auto-cherry-picking easier.

Release Notes:

- Fixed shell commands run by agents failing to find installed programs
in some cases.
92e765b5d2Cole Miller committed on 10/12/2025, 11:31:40 PM· committed by GitHubparentabc1e67
14 files changedLine totals unavailable