Skip to content

Commit 0375639

Browse files
committed
Release 1.238.2025
1 parent 3a654b3 commit 0375639

18 files changed

Lines changed: 59 additions & 483 deletions

Functions/GenXdev.FileSystem/Find-Item.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ function Find-Item {
10511051
# For path output format the path with stream
10521052
$rp = Microsoft.PowerShell.Management\Resolve-Path -LiteralPath ($itemInfo.FullName) `
10531053
-Relative -RelativeBasePath:$relativeBasePath
1054-
Microsoft.PowerShell.Utility\Write-Output "$rp`:$($stream.Stream)"
1054+
Microsoft.PowerShell.Utility\Write-Output "${rp}:$($stream.Stream)"
10551055
}
10561056
}
10571057
else {

Functions/GenXdev.FileSystem/Invoke-Fasti.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Invoke-Fasti {
4646
process {
4747

4848
# process each archive file found in current directory
49-
Microsoft.PowerShell.Management\Get-ChildItem -LiteralPath .\ -Filter $extensions -File -ErrorAction SilentlyContinue |
49+
Microsoft.PowerShell.Management\Get-ChildItem -Path $extensions -File -ErrorAction SilentlyContinue |
5050
Microsoft.PowerShell.Core\ForEach-Object {
5151

5252
Microsoft.PowerShell.Utility\Write-Verbose "Processing archive: $($PSItem.Name)"

GenXdev.FileSystem.psd1

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

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

1414
# Version number of this module.
15-
ModuleVersion = '1.236.2025'
15+
ModuleVersion = '1.238.2025'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core'
@@ -92,20 +92,16 @@ ModuleList = @('GenXdev.FileSystem')
9292
# List of all files packaged with this module
9393
FileList = 'GenXdev.FileSystem.psd1', 'GenXdev.FileSystem.psm1', 'ISSUES.md',
9494
'LICENSE', 'license.txt', 'powershell.jpg', 'README.md',
95-
'Tests\GenXdev.FileSystem\EnsurePester.Tests.ps1',
9695
'Tests\GenXdev.FileSystem\Expand-Path.Tests.ps1',
9796
'Tests\GenXdev.FileSystem\Find-DuplicateFiles.Tests.ps1',
9897
'Tests\GenXdev.FileSystem\Find-Item.Tests.ps1',
99-
'Tests\GenXdev.FileSystem\Invoke-Fasti.Tests.ps1',
10098
'Tests\GenXdev.FileSystem\Move-ItemWithTracking.Tests.ps1',
10199
'Tests\GenXdev.FileSystem\Move-ToRecycleBin.Tests.ps1',
102100
'Tests\GenXdev.FileSystem\Remove-AllItems.Tests.ps1',
103101
'Tests\GenXdev.FileSystem\Remove-ItemWithFallback.Tests.ps1',
104102
'Tests\GenXdev.FileSystem\Remove-OnReboot.Tests.ps1',
105103
'Tests\GenXdev.FileSystem\Rename-InProject.Tests.ps1',
106-
'Tests\GenXdev.FileSystem\ResolveInputObjectFileNames.Tests.ps1',
107104
'Tests\GenXdev.FileSystem\Start-RoboCopy.Tests.ps1',
108-
'Tests\GenXdev.FileSystem\_EnsureTypes.Tests.ps1',
109105
'Functions\GenXdev.FileSystem\EnsurePester.ps1',
110106
'Functions\GenXdev.FileSystem\Expand-Path.ps1',
111107
'Functions\GenXdev.FileSystem\Find-DuplicateFiles.ps1',

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Update-Module
122122
| [Remove-OnReboot](#remove-onreboot) |   | Marks files or directories for deletion during the next system boot. |
123123
| [Rename-InProject](#rename-inproject) | rip | Performs text replacement throughout a project directory. |
124124
| [ResolveInputObjectFileNames](#resolveinputobjectfilenames) |   | |
125-
| [Start-RoboCopy](#start-robocopy) | xc, rc | Provides a PowerShell wrapper for Microsoft's Robust Copy (RoboCopy) utility. |
125+
| [Start-RoboCopy](#start-robocopy) | rc, xc | Provides a PowerShell wrapper for Microsoft's Robust Copy (RoboCopy) utility. |
126126
127127
<br/><hr/><hr/><br/>
128128

Tests/GenXdev.FileSystem/EnsurePester.Tests.ps1

Lines changed: 0 additions & 30 deletions
This file was deleted.

Tests/GenXdev.FileSystem/Expand-Path.Tests.ps1

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
1-
###############################################################################
2-
3-
Pester\Describe 'Expand-Path unit tests' {
4-
5-
Pester\It 'Should pass PSScriptAnalyzer rules' {
6-
7-
# get the script path for analysis
8-
$scriptPath = GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Expand-Path.ps1"
9-
10-
# run analyzer with explicit settings
11-
$analyzerResults = GenXdev.Coding\Invoke-GenXdevScriptAnalyzer `
12-
-Path $scriptPath
13-
14-
[string] $message = ''
15-
$analyzerResults | Microsoft.PowerShell.Core\ForEach-Object {
16-
17-
$message = $message + @"
18-
--------------------------------------------------
19-
Rule: $($_.RuleName)`
20-
Description: $($_.Description)
21-
Message: $($_.Message)
22-
`r`n
23-
"@
24-
}
25-
26-
$analyzerResults.Count | Pester\Should -Be 0 -Because @"
27-
The following PSScriptAnalyzer rules are being violated:
28-
$message
29-
"@;
30-
}
1+
Pester\Describe 'Expand-Path unit tests' {
312

323
Pester\BeforeAll {
334

@@ -126,5 +97,3 @@ $message
12697
Microsoft.PowerShell.Management\Pop-Location
12798
}
12899
}
129-
130-
###############################################################################

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

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,7 @@
1-
###############################################################################
2-
Pester\BeforeAll {
3-
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
4-
}
5-
6-
Pester\AfterAll {
7-
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
8-
9-
# cleanup test folder
10-
GenXdev.FileSystem\Remove-AllItems $testRoot -DeleteFolder
11-
}
12-
13-
###############################################################################
14-
Pester\Describe 'Find-DuplicateFiles' {
15-
16-
Pester\It 'Should pass PSScriptAnalyzer rules' {
17-
18-
# get the script path for analysis
19-
$scriptPath = GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Find-DuplicateFiles.ps1"
20-
21-
# run analyzer with explicit settings
22-
$analyzerResults = GenXdev.Coding\Invoke-GenXdevScriptAnalyzer `
23-
-Path $scriptPath
24-
25-
[string] $message = ''
26-
$analyzerResults | Microsoft.PowerShell.Core\ForEach-Object {
27-
28-
$message = $message + @"
29-
--------------------------------------------------
30-
Rule: $($_.RuleName)`
31-
Description: $($_.Description)
32-
Message: $($_.Message)
33-
`r`n
34-
"@
35-
}
36-
37-
$analyzerResults.Count | Pester\Should -Be 0 -Because @"
38-
The following PSScriptAnalyzer rules are being violated:
39-
$message
40-
"@;
41-
}
1+
Pester\Describe 'Find-DuplicateFiles' {
422

433
Pester\BeforeAll {
4+
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
445
# Setup test folders with duplicate files
456
$path1 = Microsoft.PowerShell.Management\Join-Path $testRoot 'dup_test1'
467
$path2 = Microsoft.PowerShell.Management\Join-Path $testRoot 'dup_test2'
@@ -65,8 +26,11 @@ $message
6526
}
6627

6728
Pester\AfterAll {
68-
Microsoft.PowerShell.Management\Get-ChildItem -LiteralPath $testRoot -Filter "dup_test*" -Recurse -ErrorAction SilentlyContinue |
69-
Microsoft.PowerShell.Management\Remove-Item -Force -ErrorAction SilentlyContinue -Confirm:$False -Recurse
29+
30+
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
31+
32+
# cleanup test folder
33+
GenXdev.FileSystem\Remove-AllItems $testRoot -DeleteFolder
7034
}
7135

7236
Pester\It 'Ignores size comparison when specified' {

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

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,5 @@
1-
###############################################################################
21
Pester\Describe 'Find-Item 1' {
32

4-
Pester\It 'Should work with wildcard in the holding directory' {
5-
6-
$pattern = Expand-Path "$PSScriptRoot\..\..\..\..\Genx*\1*\functions\genxdev.*\*.ps1"
7-
8-
$found = @(GenXdev.FileSystem\Find-Item -SearchMask $pattern)
9-
10-
if ($found.Count -eq 0) {
11-
Write-Warning 'Find-Item still not working, see issue'
12-
}
13-
else {
14-
Write-Host 'Find-Item is FIXED!!' -ForegroundColor Cyan
15-
}
16-
17-
# $found.Count | Pester\Should -GT 0
18-
}
19-
20-
Pester\It 'Should pass PSScriptAnalyzer rules' {
21-
22-
# get the script path for analysis
23-
$scriptPath = GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Find-Item.ps1"
24-
25-
# run analyzer with explicit settings
26-
$analyzerResults = GenXdev.Coding\Invoke-GenXdevScriptAnalyzer `
27-
-Path $scriptPath
28-
29-
[string] $message = ''
30-
$analyzerResults | Microsoft.PowerShell.Core\ForEach-Object {
31-
32-
$message = $message + @"
33-
--------------------------------------------------
34-
Rule: $($_.RuleName)`
35-
Description: $($_.Description)
36-
Message: $($_.Message)
37-
`r`n
38-
"@
39-
}
40-
41-
$analyzerResults.Count | Pester\Should -Be 0 -Because @"
42-
The following PSScriptAnalyzer rules are being violated:
43-
$message
44-
"@;
45-
}
46-
473
Pester\BeforeAll {
484
$testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
495
$testDir = Microsoft.PowerShell.Management\Join-Path $testRoot 'find-item-tests'
@@ -71,6 +27,22 @@ $message
7127
GenXdev.FileSystem\Remove-AllItems $testDir
7228
}
7329

30+
Pester\It 'Should work with wildcard in the holding directory' {
31+
32+
$pattern = Expand-Path "$PSScriptRoot\..\..\..\..\Genx*\1*\functions\genxdev.*\*.ps1"
33+
34+
$found = @(GenXdev.FileSystem\Find-Item -SearchMask $pattern)
35+
36+
if ($found.Count -eq 0) {
37+
Write-Warning 'Find-Item still not working, see issue'
38+
}
39+
else {
40+
Write-Host 'Find-Item is FIXED!!' -ForegroundColor Cyan
41+
}
42+
43+
# $found.Count | Pester\Should -GT 0
44+
}
45+
7446
Pester\It 'Finds files by extension' {
7547
# setup test folder structure
7648
$testDir = GenXdev.FileSystem\Expand-Path "$testRoot\find-item-test\" -CreateDirectory
@@ -341,9 +313,8 @@ $message
341313

342314
Pester\It 'Should match the pattern' {
343315

344-
$found = @(GenXdev.FileSystem\Find-Item -SearchMask "$PSScriptRoot\..\..\..\..\..\**\Genx*stem\1.236.2025\Functions\GenXdev.FileSystem\*.ps1" -PassThru | Microsoft.PowerShell.Utility\Select-Object -ExpandProperty FullName)
316+
$found = @(GenXdev.FileSystem\Find-Item -SearchMask "$PSScriptRoot\..\..\..\..\..\**\Genx*stem\1.238.2025\Functions\GenXdev.FileSystem\*.ps1" -PassThru | Microsoft.PowerShell.Utility\Select-Object -ExpandProperty FullName)
345317

346-
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\_EnsureTypes.ps1")
347318
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\EnsurePester.ps1")
348319
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Expand-Path.ps1")
349320
$found | Pester\Should -Contain (GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Find-DuplicateFiles.ps1")

Tests/GenXdev.FileSystem/Invoke-Fasti.Tests.ps1

Lines changed: 0 additions & 30 deletions
This file was deleted.

Tests/GenXdev.FileSystem/Move-ItemWithTracking.Tests.ps1

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,21 @@
1-
###############################################################################
2-
Pester\BeforeAll {
3-
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
4-
Microsoft.PowerShell.Management\Push-Location $testRoot
5-
}
6-
7-
Pester\AfterAll {
8-
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
9-
10-
# cleanup test folder
11-
GenXdev.FileSystem\Remove-AllItems $testRoot -DeleteFolder
12-
}
13-
14-
###############################################################################
15-
Pester\Describe 'Move-ItemWithTracking' {
16-
Pester\It 'Should pass PSScriptAnalyzer rules' {
17-
# get the script path for analysis
18-
$scriptPath = GenXdev.FileSystem\Expand-Path "$PSScriptRoot\..\..\Functions\GenXdev.FileSystem\Move-ItemWithTracking.ps1"
19-
20-
# run analyzer with explicit settings
21-
$analyzerResults = GenXdev.Coding\Invoke-GenXdevScriptAnalyzer `
22-
-Path $scriptPath
23-
24-
[string] $message = ''
25-
$analyzerResults | Microsoft.PowerShell.Core\ForEach-Object {
26-
$message = $message + @"
27-
--------------------------------------------------
28-
Rule: $($_.RuleName)`
29-
Description: $($_.Description)
30-
Message: $($_.Message)
31-
`r`n
32-
"@
33-
}
34-
35-
$analyzerResults.Count | Pester\Should -Be 0 -Because @"
36-
The following PSScriptAnalyzer rules are being violated:
37-
$message
38-
"@;
39-
}
1+
Pester\Describe 'Move-ItemWithTracking' {
402

413
Pester\BeforeAll {
4+
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
5+
Microsoft.PowerShell.Management\Push-Location $testRoot
6+
427
$sourceFile = Microsoft.PowerShell.Management\Join-Path $testRoot 'track-source.txt'
438
$destFile = Microsoft.PowerShell.Management\Join-Path $testRoot 'track-dest.txt'
449
Microsoft.PowerShell.Management\Set-Content -LiteralPath $sourceFile -Value 'test content'
4510
}
4611

12+
Pester\AfterAll {
13+
$Script:testRoot = GenXdev.FileSystem\Expand-Path "$env:TEMP\GenXdev.FileSystem.Tests\" -CreateDirectory
14+
15+
# cleanup test folder
16+
GenXdev.FileSystem\Remove-AllItems $testRoot -DeleteFolder
17+
}
18+
4719
Pester\It 'Moves file with link tracking' {
4820
Pester\Mock Add-Type {
4921
return @{

0 commit comments

Comments
 (0)