Closes #35022 Release Notes: - Fixed `~` not being expanded correctly in `cwd` field of task definitions.