23 KiB
Changelog
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog. Releases up to 4.2.6 are described in the version history.
Unreleased
Added
- Publish the documentation in the
wiki, generated from the
Docsfolder after every change, with a sidebar that lists all cmdlets - Link the release notes in the PowerShell Gallery to this changelog
Changed
- Breaking: require Windows PowerShell 5.1 or PowerShell 7, and declare support for both editions in the module manifest (#61); the manifest declared PowerShell 2.0 and .NET Framework 3.5, although the module needs .NET Framework 4.5.2
- Rename the
-PassThurparameter ofRemove-Item2to-PassThru;-PassThurstill works as an alias (#64) - Publish the module as a Release build that contains only the module
files; 4.2.6 was a Debug build with debug symbols and a copy of
System.Management.Automation.dll - Document every cmdlet with synopsis, description, parameters, examples, inputs, outputs, and notes, checked against the source code
- Rewrite the home, concepts, examples, and contributor pages to match the current cmdlets, including module settings, privileges, and long paths
- Move the version history and the installation instructions from the wiki into the documentation, and complete the version history with the release dates from the PowerShell Gallery, the missing notes for 4.2.2, 4.2.5, and 4.2.6, and detailed notes for 4.2.4
- Describe the module as a PowerShell module in the manifest, which the PowerShell Gallery shows; it said Windows PowerShell, although the module supports PowerShell 7 as well
- Rename
-RemoveInheritedAccessRulesofDisable-NTFSAuditInheritanceto-RemoveInheritedAuditRulesand-RemoveExplicitAccessRulesofEnable-NTFSAuditInheritanceto-RemoveExplicitAuditRules, because they act on audit entries; the old names still work as aliases - Breaking:
Set-NTFSInheritancekeeps entries like the dedicated cmdlets:-AccessInheritanceEnabled $falsenow copies the inherited access entries into the DACL instead of removing them, and-AuditInheritanceEnabled $truenow keeps the explicit audit entries. A script that used-AccessInheritanceEnabled $falseto drop the inherited access entries now leaves them in place, which grants broader access than before. To remove the entries, useDisable-NTFSAccessInheritance -RemoveInheritedAccessRulesorEnable-NTFSAuditInheritance -RemoveExplicitAuditRules - Breaking:
Get-ChildItem2 -Attributesreturns the items that have any of the listed attributes, likeGet-ChildItem; it returned only the items that had all of them. A call that lists several attributes now returns more items, including hidden and system items when those are in the list, so review calls whose result is deleted or whose permissions are changed. To get the old result, filter withWhere-Object, as the cmdlet page shows. An empty value, such as0, is now an error; it returned every item, also the hidden ones (#5) - Breaking: remove the alias
SizeofLengthOnDiskfrom the files ofGet-ChildItem, which made the import fail in Windows PowerShell when another module had added aSizemember; useLengthOnDisk(#82) - Write only the sections of a security descriptor that changed since it
was read in
Set-NTFSSecurityDescriptor, such as the DACL afterAdd-NTFSAccess -SecurityDescriptor; a descriptor without changes writes nothing, and-Verbosenames the sections that the cmdlet writes. The cmdlet wrote every section thatGet-NTFSSecurityDescriptorhad read, also an unchanged owner, which failed with error 1307 where the account may not assign that owner (#34) - Document that
Get-NTFSEffectiveAccess -ServerNameworks only for the administrators of the named computer and the members of its group Access Control Assistance Operators; any other account gets the error "Access is denied" and no result - Breaking: require
-Pathand-TargetinNew-NTFSHardLinkandNew-NTFSSymbolicLink. Without-Path, they failed with an index error; without-Target, they used the current location, soNew-NTFSSymbolicLink -Path Linkcreated a link to the current folder - Breaking: write a non-terminating error in
New-NTFSHardLinkandNew-NTFSSymbolicLinkfor a link that they can't create, such as for an existing-Path, a missing-Target, or a path with a character that Windows doesn't allow, and continue with the next link; they stopped with a terminating error. A script that relies on the stop needs-ErrorAction Stop - Name the computer in the warning of
Get-NTFSEffectiveAccesswhen the computer of-ServerNamecan't be reached
Deprecated
- Deprecate NTFSSecurity as a whole: the project will be archived soon. Move to WindowsAccessControl, which is also on the PowerShell Gallery. The description of NTFSSecurity in the PowerShell Gallery says so as well
- Deprecate the
-PassThuralias ofRemove-Item2; use-PassThru - Deprecate the
MACTripleDESvalue ofGet-FileHash2 -Algorithm: it uses a random key, so its result differs on every call; the cmdlet now warns when you use it
Fixed
-
Retain the supplied path in the public access- and audit-rule constructors so their
FullName,Name, and simplified audit conversions identify the item -
Reduce
ReadDatatoReadin simplified audit entries, and compare them with audit entries rather than access entries, preserving equality with themselves and with equivalent simplified audit objects -
Compare boxed privilege output values by their privilege and attributes; the object overload rejected privilege values and recursively compared an attributes enum instead
-
Fix
Clear-NTFSAccess -DisableInheritanceandSet-NTFSSecurityDescriptor, which reported aRestoreOwnerErrorfor an owner that had not changed: after they took ownership of an item that the user owned already and left a DACL without the right to set an owner, they failed to set the same owner back -
Fix
Get-Help, which showed only the syntax: ship the help fileen-US\NTFSSecurity.dll-Help.xmlgenerated from the cmdlet documentation, including the links thatGet-Help -Onlineopens, instead of the outdatedNTFSSecurity-Help.xml -
Fix documentation examples that did not work, such as restoring permissions from a CSV file and filtering entries by account
-
Remove
Show-NTFSSimpleAccess, which no longer exists, and duplicate entries from the cmdlets that the module manifest exports and the PowerShell Gallery lists -
Fix
Set-NTFSInheritance, which failed with "Nullable object must have a value" when-AccessInheritanceEnabledor-AuditInheritanceEnabledwas omitted; an omitted parameter now leaves its section unchanged -
Fix
Get-ChildItem2, which stopped with anInvalidCastExceptionwhen-Pathpointed to a file; it now returns the file, likeGet-ChildItem -
Fix
Get-FileHash2, which stopped at a folder in-Pathand didn't hash the files that followed it; folders are now skipped -
Fix
Get-NTFSAudit, which returned nothing without the Security privilege instead of an error, and which returned the entries of the previous item again after a path whose security descriptor it couldn't read; it also no longer takes ownership of an item whose audit entries it can't read, which didn't help and could leave the owner changed -
Fix
Get-NTFSAccess, which returned the entries of the previous item again after a path whose ACL it couldn't read -
Fix
Add-NTFSAudit, whose-Accountand-AccessRightsparameters were both at position 2, so that positional calls failed;-AccessRightsis now at position 3, like inRemove-NTFSAudit(#4) -
Fix
-PassThruofAdd-NTFSAuditwith-SecurityDescriptorand ofRemove-NTFSAuditwith-Path, which returned access entries; both now return the audit entries -
Fix the
InheritanceEnabledproperty of audit entries, which reported the inheritance of the access entries; it now reports whether the audit entries are inherited -
Fix
Get-NTFSInheritance -SecurityDescriptor, which reportedAuditInheritanceEnabledas$truefor a security descriptor that was read without its audit section; it now reports$null, like-Path -
Fix
Get-NTFSOwner, which wrote a "The pipeline has been stopped" error for every path when a command such asSelect-Object -First 1stopped the pipeline, and which repeated a failed read instead of reporting the denied access -
Fix
Copy-Item2, which failed with aDirectoryNotFoundExceptionwhen it copied a folder that contained files -
Fix
Disable-Privileges, which couldn't disable the privileges when the module settingEnablePrivilegeswas$false -
Fix the inheritance cmdlets, which enabled the Backup, Restore, Take Ownership, and Security privileges even when the module setting
EnablePrivilegeswas$false, and left them enabled -
Fix the
Inheritscolumn of theGet-ChildItem2output, which showedTruefor every item, also for items whose inheritance is disabled -
Fix
Add-NTFSAccess,Remove-NTFSAccess,Add-NTFSAudit, andRemove-NTFSAudit, which failed with "Parameter set cannot be resolved" for-SecurityDescriptorwithout-AppliesTo,-InheritanceFlags, or-PropagationFlags;-AppliesTois now mandatory in theSimpleparameter sets, so such a command uses the flag parameters and their defaults, as for a path -
Fix
Get-NTFSEffectiveAccess:-ExcludeNoneAccessEntriesnow leaves out items without access, the cmdlet uses the current location when-Pathis omitted, and-SecurityDescriptorreturns the effective access of the security descriptor; before, all three returned nothing or ignored the parameter -
Fix
Get-NTFSOrphanedAccess,Get-NTFSOrphanedAudit, andGet-NTFSSimpleAccess, which ignored-Accountand-SecurityDescriptor;Get-NTFSOrphanedAuditnow writes one object per entry instead of one collection per item,Get-NTFSOrphanedAccessno longer repeats the entries of the previous item after a failed read, and the output ofGet-NTFSSimpleAccesshas a table view -
Restore the
-RemoveSpecificswitch ofRemove-NTFSAccess, which version 4.1 introduced but later versions lacked, and add it toRemove-NTFSAudit: with it, the cmdlets remove only an entry that matches exactly -
Fix
Copy-Item2,Move-Item2, andRemove-Item2, which skipped the remaining paths of-Pathafter a path that didn't exist or, for copy and move, a file that already existed at the destination -
Fix
Remove-NTFSAccessandRemove-NTFSAudit, which went on with a path that didn't exist, wrote a second, misleadingRemoveAceError, and with-PassThrustopped with aNullReferenceException -
Fix
-PassThruofEnable-NTFSAccessInheritance,Disable-NTFSAccessInheritance,Enable-NTFSAuditInheritance,Disable-NTFSAuditInheritance, andSet-NTFSInheritance, which returned the unchanged state of an item also when the change failed, so that the inheritance looked disabled (#74) -
Fix the error of
New-NTFSHardLinkfor a missing-Target, which said that the target path existed -
Fix
Get-FileHash2, which wrote a result for a file that it couldn't read, with the hash of the previous file -
Fix
-PassThruofAdd-NTFSAccess,Add-NTFSAudit,Remove-NTFSAccess, andRemove-NTFSAudit, which returned the unchanged entries of an item also when the change failed -
Fix the cmdlets that take ownership of an item to repeat an operation that was denied: when the second attempt failed as well, the account that ran the cmdlet stayed the owner of the item; now the previous owner is restored
-
Fix
-PassThruofEnable-PrivilegesandDisable-Privileges, which wrote the privileges as one collection instead of one object per privilege, and ofNew-NTFSSymbolicLink, which returned a file object for a link to a folder -
Declare the output types of
Test-Path2,Get-FileHash2,Add-NTFSAudit,Remove-NTFSAudit,Copy-Item2,Move-Item2,Remove-Item2, and the inheritance cmdlets correctly, so thatGet-Commandand tab completion report the objects they write -
Fix the verbose messages of
Copy-Item2andMove-Item2, which named the source path as the destination, and ofDisable-Privileges, which said that the privileges were enabled, and the spelling of the privilege in the warning ofGet-NTFSEffectiveAccess -
Fix
-PassThruofCopy-Item2,Move-Item2, andRemove-Item2, which wrote the item also when-WhatIfor a declined confirmation skipped the operation -
Fix
Get-FileHash2in PowerShell 7, where it failed for every algorithm;RIPEMD160andMACTripleDES, which .NET lacks there, now stop the cmdlet with an error that names the algorithm and points to Windows PowerShell 5.1 -
Fix a
FormatExceptionin the cmdlets for a path with braces, such asC:\Data\{Archive}: their messages formatted the path a second time (#3) -
Fix a
NullReferenceExceptionin every cmdlet when a variable namedPWDin the scope of the caller, such as a loop variable, hid the automatic variable; the cmdlets now read the current location from the session, and only for a relative path (#86) -
Fix file and folder objects passed by position, such as
Get-NTFSOwner $folder, which Windows PowerShell bound as the name of the item, so the cmdlets looked for it in the current location (#88) -
Fix
Remove-NTFSAccessfor an entry with a generic right such asGenericAll, which Windows keeps in the inherit-only entries of folders; it failed with "The value '269484032' is not valid" (#17) -
Fix
Enable-NTFSAuditInheritance,Disable-NTFSAuditInheritance, andSet-NTFSInheritance -AuditInheritanceEnabled, which failed with "Access is denied" for a file or folder without audit entries, also in an elevated session with the Security privilege -
Fix
Add-NTFSAccess,Remove-NTFSAccess,Clear-NTFSAccess,Add-NTFSAudit,Clear-NTFSAudit,Enable-NTFSAccessInheritance,Disable-NTFSAccessInheritance, andSet-NTFSInheritance, which wrote the owner of an item back with the entries they changed; where the account may not assign that owner, such as on some file servers, they failed with "(1307) This security ID may not be assigned as the owner of this object". They now write only the DACL or the SACL (#34) -
Fix
Add-NTFSAccess,Add-NTFSAudit, andClear-NTFSAudit, which in an elevated session could store the inherited access entries of an item as explicit entries, andGet-NTFSSecurityDescriptor, which could return them without their inherited flag, so thatSet-NTFSSecurityDescriptorstored them as explicit entries as well -
Fix
Clear-NTFSAudit, which finished without an error but changed nothing in a session without the Security privilege; it now writes an error, like the other audit cmdlets -
Fix the cmdlets for the root of a drive, such as
C:\, or of a volume, such as\\?\Volume{GUID}\, which read and changed the security descriptor of the drive, a device object, instead of that of its root folder, so thatGet-NTFSAccessshowed other entries than Explorer (#41) -
Fix
Add-NTFSAudit,Remove-NTFSAudit, andClear-NTFSAuditwith a security descriptor that was read without the audit entries; they now write an error likeGet-NTFSAuditinstead of changing the missing entries without one (#109) -
Fix
Get-NTFSEffectiveAccess, which blamed a missing Security privilege for every failure while the privilege wasn't enabled; the error now names the cause that Windows reported (#109) -
Fix
Copy-Item2andMove-Item2, which wrote an error with-WhatIfwhen the destination file existed, so that-WhatIf -ErrorAction Stopstopped the preview; they now name the existing file in a verbose message (#108) -
Fix
Remove-NTFSAudit, which failed with "(5) Access is denied" for a file or folder without audit entries -
Fix
Set-NTFSSecurityDescriptor, which set the previous owner back after it had taken ownership to write a descriptor that sets a new owner, so that the new owner was lost or the write failed with error 1307 -
Fix the
Writemethod of aSecurity2.FileSystemSecurity2object for another item, which wrote every section of the descriptor, also an owner that Windows returns with the DACL; it now writes the sections that the descriptor was read with (#34) -
Fix
Disable-Privileges, which warned that it couldn't disable the privileges that the access token doesn't hold, and the declared output type ofGet-FileHash2, which named the AlphaFSFileInfoinstead of the type name of its objects (#111) -
Fix
Get-NTFSEffectiveAccess, which returned no access when the computer of-ServerNamecouldn't be reached, although it warned that it had calculated the result on this computer; it now returns that result -
Fix
Test-Path2, which stopped with the terminating error "Illegal characters in path" in Windows PowerShell for a path with a character that Windows doesn't allow in names, such as|; it now returns$falsefor such a path, as in PowerShell 7, and writes the reason as a debug message -
Fix the cmdlets that enable the Backup, Restore, Take Ownership, and Security privileges, which left them enabled in the session when a later command, such as
Select-Object -First, or a terminating error stopped the pipeline early; they now disable them also then -
Fix the cmdlets that enable the privileges, which stopped with the error "Priviledge already disabled" and left the other privileges enabled when another command in the pipeline, such as
Disable-Privileges, had disabled one of them; a privilege that they can't disable now gives a warning, and they still disable the others -
Fix
Get-NTFSSimpleAccess, which showed no rights for an entry that grants onlyReadData, and which left out the parent folder of a relative path with a single folder name, although-IncludeRootFolderis on by default -
Fix
Copy-Item2andMove-Item2, which didn't detect a folder at the destination, so that a copy failed in the middle after it had copied a part of the folder, and which reported a missing destination folder with an error that named the source item (#21); they now writeDestinationFileAlreadyExistsand an error that names the missing folder, and with-WhatIfa verbose message that names it.Copy-Item2no longer creates the missing folders of the destination when it copies a folder, which the prereleases of 5.0.0 did -
Fix
Get-NTFSHardLink, which stopped for all remaining paths at a folder and at a file on a network share, where Windows can't list the names of a file, andNew-NTFSHardLink -PassThru, which stopped with a terminating error on a share after it had created the link; both now write a non-terminatingGetHardLinkError -
Fix
-PassThruofSet-NTFSSecurityDescriptor, which returned nothing for a descriptor that the cmdlet wrote as the owner, and which turned a failed read after a successful write into another attempt of the write and aWriteSdError; it now writes aReadSecurityErrorfor that read -
Fix
Get-NTFSOrphanedAccess, which reported an item that it couldn't read as anAddAceError; it now writes aReadSecurityError, likeGet-NTFSAccess -
Fix every cmdlet for a relative path that starts with a dot but not with
.\, such as.gitignore: the cmdlets dropped its first two characters and read, changed, or removed the item with the shorter name, such asitignore, when one existed -
Fix comparing the objects of the access, audit, and security descriptor cmdlets:
-eqand-contains, and in PowerShell 7 alsoSelect-Object -UniqueandCompare-Object, stopped with anInvalidCastException, and a security descriptor as the key of a hashtable with aNullReferenceException. Two objects are now equal when they hold the same entry or descriptor, as in .NET. Converting a security descriptor toFileSecurityorDirectorySecurityreturned$null -
Fix
InheritedFromofGet-NTFSAccessandGet-NTFSAudit: with-ExcludeExplicit, each inherited entry showed the source of another entry, andGet-NTFSAccess -SecurityDescriptorstopped with anArgumentOutOfRangeExceptionfor a descriptor with audit entries, such as one thatGet-NTFSSecurityDescriptorreads in an elevated session -
Fix
Get-NTFSOrphanedAudit, which returned nothing without the Security privilege, as for an item without orphaned entries, and wrote a warning for an item that it couldn't read; it now writes aReadSecurityError, likeGet-NTFSAudit -
Fix
Get-NTFSSimpleAccess, which left out a folder whose parent folder it hadn't reported, and with it all of its subfolders, and which compared a drive root with the parent folder of the folder before it; such folders are now reported with all of their entries, and a parent folder is found also when its path differs in case. A folder that came after its parent folder a second time failed with aReadError -
Fix
Move-Item2for a folder on another volume, which Windows can't move: the cmdlet copied and deleted it instead, so that an empty folder was deleted without being created at the destination, and a folder with files failed with an error that named one of its files. It now writes aMoveErrorthat names the folder and the destination, and leaves the folder in place -
Fix
New-NTFSHardLinkandNew-NTFSSymbolicLink, which failed withGetDefaultValueFailedfor every object piped to them, such as the rows of a CSV file with the columnsPathandTarget -
Fix the errors of
New-NTFSSymbolicLinkfor an existing-Pathand a missing-Target, and ofNew-NTFSHardLinkfor a folder as-Target, which named no path.New-NTFSSymbolicLinknow checks-Pathfirst, likeNew-NTFSHardLink -
Fix
Get-NTFSEffectiveAccess, which warned that the result might be inaccurate for every name of this computer in-ServerNameexceptlocalhostin lowercase, such as.,LOCALHOST, or the computer name, where the computer doesn't offer the remote access check -
Fix Get-ChildItem2 with
-Hidden, which omitted the first hidden item unless-Forcewas also supplied