Skip to content

Commit e0bc602

Browse files
committed
Release 1.290.2025
1 parent 80f7106 commit e0bc602

17 files changed

+406
-202
lines changed

.github/workflows/test.yml

Lines changed: 351 additions & 169 deletions
Large diffs are not rendered by default.

Functions/GenXdev.AI.Queries/Set-AIImageCollection.ps1

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,19 @@ function Set-AIImageCollection {
341341
$ImageDirectories = ($ImageDirectories ? $ImageDirectories : $DefaultValue)
342342
$Json = $ImageDirectories | Microsoft.PowerShell.Utility\ConvertTo-Json -Compress
343343

344-
$params = GenXdev.Helpers\Copy-IdenticalParamValues `
345-
-BoundParameters $PSBoundParameters `
346-
-FunctionName 'GenXdev.Data\Set-GenXdevPreference'
347-
348-
$null = GenXdev.Data\Set-GenXdevPreference @params `
349-
-Name 'AIImageCollection' `
350-
-Value $Json
344+
# confirm the operation with the user before proceeding
345+
if ($PSCmdlet.ShouldProcess(
346+
"AI Image Collection settings",
347+
"Update image directories and language preferences")) {
348+
349+
$params = GenXdev.Helpers\Copy-IdenticalParamValues `
350+
-BoundParameters $PSBoundParameters `
351+
-FunctionName 'GenXdev.Data\Set-GenXdevPreference'
352+
353+
$null = GenXdev.Data\Set-GenXdevPreference @params `
354+
-Name 'AIImageCollection' `
355+
-Value $Json
356+
}
351357

352358
}
353359
################################################################################

Functions/GenXdev.AI/Approve-NewTextFileContent.ps1

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,12 @@ function Approve-NewTextFileContent {
335335
begin {
336336

337337
# ensure content path exists, create if missing
338-
$contentPath = GenXdev.FileSystem\Expand-Path $ContentPath -CreateFile
338+
$contentPath = GenXdev.FileSystem\Expand-Path $ContentPath `
339+
-CreateFile
339340

340-
Microsoft.PowerShell.Utility\Write-Verbose "Target file path: $contentPath"
341+
# log the target file path for debugging
342+
Microsoft.PowerShell.Utility\Write-Verbose (
343+
"Target file path: ${contentPath}")
341344
}
342345

343346

@@ -346,17 +349,23 @@ function Approve-NewTextFileContent {
346349
# check initial file existence for tracking deletion
347350
$existed = [System.IO.File]::Exists($contentPath)
348351

349-
Microsoft.PowerShell.Utility\Write-Verbose "File existed before comparison: $existed"
352+
# log initial file existence state
353+
Microsoft.PowerShell.Utility\Write-Verbose (
354+
"File existed before comparison: ${existed}")
350355

351356
# create temporary file with matching extension for comparison
352-
$tempFile = GenXdev.FileSystem\Expand-Path ([System.IO.Path]::GetTempFileName() +
357+
$tempFile = GenXdev.FileSystem\Expand-Path (
358+
[System.IO.Path]::GetTempFileName() +
353359
[System.IO.Path]::GetExtension($contentPath)) `
354360
-CreateDirectory
355361

356-
Microsoft.PowerShell.Utility\Write-Verbose "Created temp comparison file: $tempFile"
362+
# log temporary file creation
363+
Microsoft.PowerShell.Utility\Write-Verbose (
364+
"Created temp comparison file: ${tempFile}")
357365

358366
# write proposed content to temp file
359-
$NewContent | Microsoft.PowerShell.Utility\Out-File $tempFile -Force
367+
$NewContent |
368+
Microsoft.PowerShell.Utility\Out-File $tempFile -Force
360369

361370
# launch winmerge for interactive comparison
362371
$null = GenXdev.AI\Invoke-WinMerge `
@@ -366,26 +375,39 @@ function Approve-NewTextFileContent {
366375

367376
# prepare result tracking object
368377
$result = @{
378+
369379
approved = [System.IO.File]::Exists($contentPath)
370380
}
371381

372382
if ($result.approved) {
373383

374-
# check if content was modified during comparison
375-
$content = Microsoft.PowerShell.Management\Get-Content -LiteralPath $contentPath -Raw
384+
# read file content to check for modifications
385+
$content = [System.IO.File]::ReadAllText($contentPath)
386+
387+
# compare original and modified content
376388
$changed = $content.Trim() -ne $NewContent.Trim()
377389

390+
# track if content was accepted without changes
378391
$result.approvedAsIs = -not $changed
379392

380393
if ($changed) {
394+
395+
# store the user-modified content
381396
$result.savedContent = $content
382397
}
383398
}
384399
elseif ($existed) {
400+
401+
# track if user deleted the existing file
385402
$result.userDeletedFile = $true
386403
}
387404

388-
Microsoft.PowerShell.Utility\Write-Verbose "Comparison result: $($result | Microsoft.PowerShell.Utility\ConvertTo-Json)"
405+
# log the comparison result
406+
Microsoft.PowerShell.Utility\Write-Verbose (
407+
"Comparison result: $(
408+
$result |
409+
Microsoft.PowerShell.Utility\ConvertTo-Json)")
410+
389411
return $result
390412
}
391413

GenXdev.AI.ComfyUI.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.AI.Data.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.AI.DeepStack.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.AI.LMStudio.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.AI.Queries.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.AI.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

Tests/GenXdev.AI.ComfyUI/EnsureComfyUIModel.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pester\Describe 'EnsureComfyUIModel' {
22

3-
Pester\It 'Should have valid download URLs for all supported models' {
3+
Pester\It 'Should have valid download URLs for all supported models' -Skip:(-not ($Global:AllowLongRunningTests -eq $true)){
44

55
# Load the supported models configuration
66
$jsonPath = Microsoft.PowerShell.Management\Join-Path $PSScriptRoot "..\..\Functions\GenXdev.AI.ComfyUI\SupportedComfyUIModels.json"
@@ -110,7 +110,7 @@
110110
}
111111
}
112112

113-
Pester\It 'Should detect and mark incompatible models for removal' {
113+
Pester\It 'Should detect and mark incompatible models for removal'-Skip:(-not ($Global:AllowLongRunningTests -eq $true)){
114114

115115
# Load the supported models configuration
116116
$jsonPath = Microsoft.PowerShell.Management\Join-Path $PSScriptRoot "..\..\Functions\GenXdev.AI.ComfyUI\SupportedComfyUIModels.json"
@@ -172,7 +172,7 @@
172172
$true | Pester\Should -Be $true -Because "Model compatibility check completed (warnings provided for any issues)"
173173
}
174174

175-
Pester\It 'Should correctly map available model files to supported models using FileName property' {
175+
Pester\It 'Should correctly map available model files to supported models using FileName property' -Skip:(-not ($Global:AllowLongRunningTests -eq $true)){
176176

177177
# Load the supported models configuration
178178
$jsonPath = Microsoft.PowerShell.Management\Join-Path $PSScriptRoot "..\..\Functions\GenXdev.AI.ComfyUI\SupportedComfyUIModels.json"
@@ -206,7 +206,7 @@
206206
Microsoft.PowerShell.Utility\Write-Verbose "Model filename mapping logic validation completed successfully"
207207
}
208208

209-
Pester\It 'Should accept all ValidateSet model names' {
209+
Pester\It 'Should accept all ValidateSet model names' -Skip:(-not ($Global:AllowLongRunningTests -eq $true)){
210210

211211
# Load the supported models configuration to get current model names
212212
$jsonPath = Microsoft.PowerShell.Management\Join-Path $PSScriptRoot "..\..\Functions\GenXdev.AI.ComfyUI\SupportedComfyUIModels.json"

0 commit comments

Comments
 (0)