This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EditionID] | |
Professional | |
[Channel] | |
Retail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Restore-Ownership { | |
<# | |
.SYNOPSIS | |
Restores file/folder ownership for the current user or the Administrators group. | |
.DESCRIPTION | |
The `Restore-Ownership` cmdlet restores ownership of files and/or folders | |
for the current Windows user (default), or the BUILTIN\Administrators group. | |
This is accomplished using `takeown.exe` to take ownership of the file or | |
folder, followed by `Set-Acl` to add a `System.Security.AccessControl.FileSystemAccessRule` |