Skip to content

Allow Windows users in developer mode to create symlinks without elevation - #8534

Merged
Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:win-symlink
Jan 8, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:win-symlink

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 24, 2018 •

Copy link
Copy Markdown
Member

PR Summary

Leverage new flag in CreateSymbolicLink() API to not require elevation if using Developer Mode. Include check if using WIn10 >= build 14972 which supports the new flag. Modified tests to check if developer mode is enabled.

Fix #2845

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

Related test failed (Should error correctly when failing to create a symbolic link).

@lzybkr

Copy link
Copy Markdown
Contributor

Do you need an OS version check or a check for developer mode? Some APIs reject unknown/unsupported flags.

Or to put it another way, did you test on Win7/Win8 and on Win10 w/ developer mode turned off?

@ExE-Boss

ExE Boss (ExE-Boss) commented Dec 25, 2018 •

Copy link
Copy Markdown

Do you need an OS version check or a check for developer mode? Some APIs reject unknown/unsupported flags.

IIRC, I’m pretty sure that this is one such API (you need an OS version check, as the developer mode check is done by Windows 10).

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Updated test to handle whether it's in Developer Mode or not. Validated on Win10 that when Developer Mode is not enabled, it fails as previously without elevation. Win7 still installing updates.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Manually verified on Win7

@adityapatwardhan

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) I think this will be a breaking change. Do you agree?

@ExE-Boss

ExE Boss (ExE-Boss) commented Jan 8, 2019 •

Copy link
Copy Markdown

Aditya Patwardhan (@adityapatwardhan) I don’t think so, given that previously it would be impossible to create symlinks without elevation, but with this, when developer mode is enabled, it’s possible to create symlinks without requiring eleveation.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Aditya Patwardhan (@adityapatwardhan) I don't think it's a breaking change in the sense that it's impactful. It would only affect tests that previously expected failure.

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 8, 2019
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit d6000fd into PowerShell:master Jan 8, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the win-symlink branch January 8, 2019 19:06
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leverage new API for creating symlink without administrator privileges on Windows

5 participants