Skip to content

[Windows-2025] Enable permission inheritance for the C: drive #12467

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Alexey-Ayupov
Copy link
Contributor

Description

This pull request enables inheritance for the entire `C: drive in the Windows-2025 image.

Related issue:

https://github.com/github/c2c-actions-support/issues/4894

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 16:36
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.

Pull Request Overview

This PR adds a step to enable permission inheritance on the entire C:\ drive in the Windows-2025 image.

  • Added a conditional block that runs the icacls command to modify inheritance settings.
  • Includes error handling to throw an exception if enabling inheritance fails.

@@ -36,6 +36,14 @@ if ($LASTEXITCODE -ne 0) {
throw "Failed to grant Users full control of $env:SystemRoot\Temp"
}

# Enable inheritance for the entire C:\ drive
if (Test-IsWin25) {
cmd /c "icacls C:\ /inheritance:e /c /q 2>&1" | Out-Null
Copy link
Preview

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

Consider capturing and logging the output of the icacls command rather than discarding it. This would help with troubleshooting if the inheritance change fails.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants