Skip to content

Conversation

anmenaga
Copy link

PR Summary

Fix #618

Winget creates a symlink at its own location C:\Users\Andrew\AppData\Local\Microsoft\WinGet\Links and adds that to the PATH instead of the real target, so built-in resources/settings discovery finds nothing.

This PR updates code to use the target path if invoked dsc.exe is a symlink.

Fix verified on a Winget deployment of DSC.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

}
}

Err(DscError::NotSupported("Can't get the path to dsc executable".to_string()))
Copy link
Preview

Copilot AI Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message could be more informative. Consider including the specific error encountered.

Suggested change
Err(DscError::NotSupported("Can't get the path to dsc executable".to_string()))
Err(DscError::NotSupported(format!("Can't get the path to dsc executable: {}", env::current_exe().unwrap_err())))

Copilot uses AI. Check for mistakes.

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jan 16, 2025
Merged via the queue into PowerShell:main with commit 1e31d85 Jan 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlink breaks dsc.exe
2 participants