From 5b8ae9f19a5700188d89f98e1b004063ac7cb344 Mon Sep 17 00:00:00 2001 From: Raimund Andree Date: Mon, 5 Oct 2026 08:10:54 +0200 Subject: [PATCH] feat!: remove the Size alias that blocked the import next to other modules The types file added the alias Size of LengthOnDisk to System.IO.FileInfo. Type data can't replace an existing member, so in Windows PowerShell the import failed when another module had added a Size member first (#82). BREAKING CHANGE: use LengthOnDisk instead of Size. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: AI Assistant --- .memory-bank/progress.md | 8 +++++--- CHANGELOG.md | 4 ++++ Docs/Concepts.md | 2 +- NTFSSecurity/NTFSSecurity.types.ps1xml | 4 ---- Tests/Manifest.Tests.ps1 | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.memory-bank/progress.md b/.memory-bank/progress.md index d492941..4997c55 100644 --- a/.memory-bank/progress.md +++ b/.memory-bank/progress.md @@ -188,6 +188,8 @@ Numbered as agreed with the maintainer; each is documented on its page. recurring questions. - Review of #17: generic rights are removed the way .NET removes other rights, an exact match as it is, otherwise without `Synchronize`. -- Open bugs: #5 (`-Attributes` matches all, `Get-ChildItem` any; needs a - decision), #34 and #67 (writes owner and group), #41 (drive root), #82 - (`Size` type data), #90 (trailing space). +- Maintainer decisions of 2026-10-05: #5 (`Get-ChildItem2 -Attributes` + matches any listed attribute) and #82 (no `Size` alias) ship in 5.0.0 as + breaking changes. +- Open bugs: #34 and #67 (writes owner and group, rc3 if a file server is + available), #41 (drive root) and #90 (trailing space), both after 5.0.0. diff --git a/CHANGELOG.md b/CHANGELOG.md index 4814538..718cb6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,10 @@ The format is based on that had all of them. To get the old result, filter with `Where-Object`, as the cmdlet page shows ([#5](https://github.com/raandree/NTFSSecurity/issues/5)) +- **Breaking:** remove the alias `Size` of `LengthOnDisk` from the files of + `Get-ChildItem`, which made the import fail in Windows PowerShell when + another module had added a `Size` member; use `LengthOnDisk` + ([#82](https://github.com/raandree/NTFSSecurity/issues/82)) ### Deprecated diff --git a/Docs/Concepts.md b/Docs/Concepts.md index 1852861..9ba01cf 100644 --- a/Docs/Concepts.md +++ b/Docs/Concepts.md @@ -234,7 +234,7 @@ the AlphaFS objects that the `*-Item2` cmdlets return. | --- | --- | --- | --- | | `Owner` | Property | Files and folders | The owner of the item. | | `IsInheritanceBlocked` | Property | Files and folders | `$true` if the item does not inherit access entries. | -| `LengthOnDisk` | Property | Files | The file size rounded up to whole clusters of the volume. `Size` is an alias. | +| `LengthOnDisk` | Property | Files | The file size rounded up to whole clusters of the volume. Before 5.0.0, `Size` was an alias. | | `EnableInheritance()` | Method | Files and folders | Turns on access inheritance. | | `DisableInheritance()` | Method | Files and folders | Turns off access inheritance. Pass `$false` to drop the inherited entries instead of copying them. | | `GetHash()` | Method | Files | Returns the SHA1 hash of the file as a hexadecimal string. | diff --git a/NTFSSecurity/NTFSSecurity.types.ps1xml b/NTFSSecurity/NTFSSecurity.types.ps1xml index 4944423..681e8fc 100644 --- a/NTFSSecurity/NTFSSecurity.types.ps1xml +++ b/NTFSSecurity/NTFSSecurity.types.ps1xml @@ -23,10 +23,6 @@ [Math]::Ceiling($this.Length / ($driveInfo.BytesPerSector * $driveInfo.SectorsPerCluster)) * ($driveInfo.BytesPerSector * $driveInfo.SectorsPerCluster) - - Size - LengthOnDisk - EnableInheritance