Skip to content

Commit 0196a15

Browse files
committed
Release 1.208.2025
1 parent 5997a65 commit 0196a15

5 files changed

Lines changed: 111 additions & 7 deletions

File tree

GenXdev.FileSystem.psd1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: genXdev
55
#
6-
# Generated on: 17/07/2025
6+
# Generated on: 19/07/2025
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = 'GenXdev.FileSystem.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.202.2025'
15+
ModuleVersion = '1.208.2025'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core'
@@ -90,8 +90,8 @@ AliasesToExport = 'ep', 'fasti', 'fdf', 'l', 'rc', 'recycle', 'rip', 'rmf', 'sde
9090
ModuleList = @('GenXdev.FileSystem')
9191

9292
# List of all files packaged with this module
93-
FileList = 'GenXdev.FileSystem.psd1', 'GenXdev.FileSystem.psm1', 'LICENSE',
94-
'license.txt', 'powershell.jpg', 'README.md',
93+
FileList = 'GenXdev.FileSystem.psd1', 'GenXdev.FileSystem.psm1', 'ISSUES.md',
94+
'LICENSE', 'license.txt', 'powershell.jpg', 'README.md',
9595
'Tests\GenXdev.FileSystem\EnsurePester.Tests.ps1',
9696
'Tests\GenXdev.FileSystem\Expand-Path.Tests.ps1',
9797
'Tests\GenXdev.FileSystem\Find-DuplicateFiles.Tests.ps1',
@@ -143,7 +143,7 @@ PrivateData = @{
143143
# Prerelease = ''
144144

145145
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
146-
# RequireLicenseAcceptance = $false
146+
RequireLicenseAcceptance = $true
147147

148148
# External dependent modules of this module
149149
# ExternalModuleDependencies = @()

GenXdev.FileSystem.psm1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
if (-not $IsWindows) {
2+
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"
3+
}
4+
5+
$osVersion = [System.Environment]::OSVersion.Version
6+
$major = $osVersion.Major
7+
$build = $osVersion.Build
8+
9+
if ($major -ne 10) {
10+
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"
11+
}
12+
13+
114
. "$PSScriptRoot\Functions\GenXdev.FileSystem\EnsurePester.ps1"
215
. "$PSScriptRoot\Functions\GenXdev.FileSystem\Expand-Path.ps1"
316
. "$PSScriptRoot\Functions\GenXdev.FileSystem\Find-DuplicateFiles.ps1"

ISSUES.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
````markdown
2+
## Critique of the GenXdev.FileSystem PowerShell Module
3+
4+
![image1](powershell.jpg)
5+
6+
### Strengths
7+
8+
1. **Feature-Rich**:
9+
The module provides a wide range of commands—covering everything from robust file/directory search (`Find-Item`) to advanced copy/move operations (`Start-RoboCopy`, `Move-ItemWithTracking`), recycle bin support, and even project-wide text renaming. Its breadth is impressive for Windows filesystem automation.
10+
11+
2. **Documentation**:
12+
The README is thorough, with command syntax, parameter explanations, and usage examples. The inclusion of aliases is user-friendly, and the MIT license is clear.
13+
14+
3. **Test Coverage**:
15+
There is strong evidence of automated testing using Pester, with script analyzer checks and functional tests for all major commands. This is a sign of mature engineering practice.
16+
17+
4. **Platform Checks**:
18+
The module enforces Windows 10+ and PowerShell 7.5+ usage, avoiding cross-platform surprises.
19+
20+
5. **Defensive Coding**:
21+
Functions like `Remove-ItemWithFallback` and `Remove-OnReboot` offer robust error handling, with fallback strategies for locked files and registry-based deletion scheduling.
22+
23+
### Weaknesses & Criticisms
24+
25+
#### 1. **Platform Rigidity & Hard Dependencies**
26+
- The hard check for Windows 10+ and PowerShell 7.5+ is restrictive. While justified for some features, it prevents partial functionality on earlier versions or on non-Windows environments where basic operations could work.
27+
- The module requires the `Microsoft.WinGet.Client` and expects `7-Zip` and `winget` for archive extraction. These dependencies are not always present in enterprise or minimal environments and can cause runtime failures.
28+
29+
#### 2. **Complexity & Maintainability**
30+
- The code is highly complex, especially in `Find-Item`, which re-implements recursive wildcard searching and alternate data stream (ADS) support from scratch using stacks and manual path parsing. This reinvention can introduce subtle bugs and is hard to maintain.
31+
- Some functions use large, monolithic process blocks which mix logic, error handling, and user interaction, making the code harder to read and extend.
32+
33+
#### 3. **Verbosity and Logging**
34+
- The module is very verbose, outputting a lot of information via `Write-Information` and `Write-Verbose`. While useful for debugging, this can overwhelm users during normal usage, especially on large directory trees.
35+
36+
#### 4. **Redundant or Ambiguous Parameters**
37+
- Some parameters are ambiguous or overlap, e.g., both `SkipDirectories` and `SkipEmptyDirectories` in `Start-RoboCopy` can confuse users as to their combined effect.
38+
- The `ForceDrive` parameter in `Expand-Path` is powerful but under-documented and could lead to confusing behavior, especially when combined with wildcards.
39+
40+
#### 5. **Error Handling and User Feedback**
41+
- While the module tries to fall back gracefully, some error messages are generic or simply rethrow exceptions. More actionable feedback (e.g., in case of permission errors or missing dependencies) would help users resolve issues faster.
42+
- Functions sometimes swallow errors and continue, risking silent failures (e.g., failed directory merges in `Rename-InProject`).
43+
44+
#### 6. **Security Implications**
45+
- The module manipulates the registry (`Remove-OnReboot`) and performs operations with elevated rights based on role checks, which can have system-wide effects. There is potential risk if run by non-expert users, and no clear "dry run" mode for all destructive operations (though some support `-WhatIf`).
46+
47+
#### 7. **Performance**
48+
- The approach to directory traversal (custom stack, manual recursion) in `Find-Item` may not scale well on massive file trees compared to native .NET APIs or PowerShell's built-in `Get-ChildItem -Recurse`.
49+
- The module sometimes reads entire files into memory for content search and replacement, which is not efficient for large files.
50+
51+
#### 8. **Coding Conventions & Consistency**
52+
- The code mixes .NET direct calls, PowerShell cmdlets, and custom logic inconsistently.
53+
- There are minor naming inconsistencies (e.g., `CopyJunctionsAsJunctons`) and inconsistent parameter casing.
54+
55+
### Summary
56+
57+
**GenXdev.FileSystem** is a robust, feature-rich PowerShell module for advanced file management. However, its complexity, rigid dependencies, and custom implementations make it harder to maintain and extend. The user experience could be improved by simplifying parameter sets, improving error messages, and more judicious use of verbosity. Security and performance implications should be documented for end users.
58+
59+
#### Recommendations:
60+
- Simplify and modularize code, especially for directory and file searching.
61+
- Reduce or make verbosity optional by default.
62+
- Better document and handle external dependencies.
63+
- Improve error messages and user feedback.
64+
- Consider cross-platform support for non-Windows users, even if partial.
65+
````

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@
1010
A Windows PowerShell module for basic and advanced file management tasks
1111
[![GenXdev.FileSystem](https://img.shields.io/powershellgallery/v/GenXdev.FileSystem.svg?style=flat-square&label=GenXdev.FileSystem)](https://www.powershellgallery.com/packages/GenXdev.FileSystem/) [![License](https://img.shields.io/github/license/genXdev/GenXdev.FileSystem?style=flat-square)](./LICENSE)
1212

13+
## MIT License
14+
15+
```text
16+
MIT License
17+
18+
Copyright (c) [year] [fullname]
19+
20+
Permission is hereby granted, free of charge, to any person obtaining a copy
21+
of this software and associated documentation files (the "Software"), to deal
22+
in the Software without restriction, including without limitation the rights
23+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24+
copies of the Software, and to permit persons to whom the Software is
25+
furnished to do so, subject to the following conditions:
26+
27+
The above copyright notice and this permission notice shall be included in all
28+
copies or substantial portions of the Software.
29+
30+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36+
SOFTWARE.
37+
````
38+
1339
### FEATURES
1440
1541
* ✅ Simple but agile utility for renaming text throughout a project directory,

Tests/GenXdev.FileSystem/Find-Item.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
Pester\Describe 'Find-Item 1' {
33

44
Pester\It 'Should work with wildcard in the holding directory' {
@@ -338,7 +338,7 @@ $message
338338

339339
Pester\It 'Should match the pattern' {
340340

341-
$found = @(GenXdev.FileSystem\Find-Item -SearchMask "$PSScriptRoot\..\..\..\..\..\**\Genx*stem\1.202.2025\Functions\GenXdev.FileSystem\*.ps1" -PassThru | Microsoft.PowerShell.Utility\Select-Object -ExpandProperty FullName)
341+
$found = @(GenXdev.FileSystem\Find-Item -SearchMask "$PSScriptRoot\..\..\..\..\..\**\Genx*stem\1.208.2025\Functions\GenXdev.FileSystem\*.ps1" -PassThru | Microsoft.PowerShell.Utility\Select-Object -ExpandProperty FullName)
342342

343343
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\_EnsureTypes.ps1")
344344
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\EnsurePester.ps1")

0 commit comments

Comments
 (0)