Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix built-in resource and settings discovery when dsc is invoked using a symlink #625

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

anmenaga
Copy link
Collaborator

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

@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 is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@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