Skip to content

Commit ab745e6

Browse files
committed
Release 1.208.2025
1 parent 2936cbd commit ab745e6

15 files changed

Lines changed: 737 additions & 603 deletions

Functions/GenXdev.AI.DeepStack/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@
66

77
This module provides PowerShell functions to interact with DeepStack's face recognition API running in a Docker container. DeepStack offers powerful, privacy-focused AI capabilities including face detection, face recognition, object detection, and image enhancement.
88

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

Functions/GenXdev.AI.Queries/Add-ImageDirectories.ps1

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ function Add-ImageDirectories {
5353
[Alias('addimgdir')]
5454

5555
param(
56-
#
56+
###############################################################################
5757
[Parameter(
5858
Mandatory = $true,
5959
Position = 0,
6060
ValueFromPipeline = $true,
6161
HelpMessage = 'Array of directory paths to add to image directories'
6262
)]
6363
[Alias('imagespath', 'directories', 'imgdirs', 'imagedirectory')]
64-
[string[]] $ImageDirectories, ################################################################################
64+
[string[]] $ImageDirectories,
65+
################################################################################
6566
[Parameter(
6667
Mandatory = $false,
6768
HelpMessage = ('Use alternative settings stored in session for AI ' +
@@ -94,60 +95,56 @@ function Add-ImageDirectories {
9495
)
9596

9697
begin {
98+
try {
99+
# retrieve current image directories configuration
100+
$params = GenXdev.Helpers\Copy-IdenticalParamValues `
101+
-BoundParameters $PSBoundParameters `
102+
-FunctionName 'GenXdev.AI\Get-AIImageCollection' `
103+
-DefaultValues (Microsoft.PowerShell.Utility\Get-Variable `
104+
-Scope Local `
105+
-ErrorAction SilentlyContinue)
97106

98-
# retrieve current image directories configuration
99-
$params = GenXdev.Helpers\Copy-IdenticalParamValues `
100-
-BoundParameters $PSBoundParameters `
101-
-FunctionName 'GenXdev.AI\Get-AIImageCollection' `
102-
-DefaultValues (Microsoft.PowerShell.Utility\Get-Variable `
103-
-Scope Local `
104-
-ErrorAction SilentlyContinue)
105-
106-
$currentConfig = Get-AIImageCollection @params
107+
$currentConfig = Get-AIImageCollection @params
107108

108-
# initialize new collection to store all directories including existing ones
109-
$newDirectories = [System.Collections.Generic.List[string]]::new()
109+
# initialize new collection to store all directories including existing ones
110+
$newDirectories = [System.Collections.Generic.List[string]]::new()
110111

111-
# populate collection with existing directories to preserve them
112-
foreach ($dir in $currentConfig) {
112+
# populate collection with existing directories to preserve them
113+
foreach ($dir in $currentConfig) {
114+
$newDirectories.Add($dir)
115+
}
113116

114-
$newDirectories.Add($dir)
117+
# output current configuration state for debugging purposes
118+
Microsoft.PowerShell.Utility\Write-Verbose (
119+
'Current image directories: ' +
120+
"[$($currentConfig -join ', ')]"
121+
)
122+
} catch {
123+
Write-Error "Failed to retrieve current image directories: $_"
124+
return
115125
}
116-
117-
# output current configuration state for debugging purposes
118-
Microsoft.PowerShell.Utility\Write-Verbose (
119-
'Current image directories: ' +
120-
"[$($currentConfig -join ', ')]"
121-
)
122126
}
123127

124128
process {
125-
126-
# iterate through each provided directory path for processing
127129
foreach ($directory in $ImageDirectories) {
128-
129-
# expand path to resolve relative paths and environment variables
130-
$expandedPath = GenXdev.FileSystem\Expand-Path $directory
131-
130+
try {
131+
# expand path to resolve relative paths and environment variables
132+
$expandedPath = GenXdev.FileSystem\Expand-Path $directory
133+
} catch {
134+
Write-Error "Failed to expand path '$directory': $_"
135+
continue
136+
}
132137
# search for existing directory using case-insensitive comparison
133138
$existingDir = $newDirectories |
134139
Microsoft.PowerShell.Core\Where-Object {
135140
$_.ToLower() -eq $expandedPath.ToLower()
136141
}
137-
138-
# add directory only if it doesn't already exist in collection
139142
if (-not $existingDir) {
140-
141143
$newDirectories.Add($expandedPath)
142-
143-
# output verbose message about successful addition
144144
Microsoft.PowerShell.Utility\Write-Verbose (
145145
"Adding directory: $expandedPath"
146146
)
147-
}
148-
else {
149-
150-
# output verbose message about duplicate directory skip
147+
} else {
151148
Microsoft.PowerShell.Utility\Write-Verbose (
152149
"Directory already exists: $expandedPath"
153150
)

0 commit comments

Comments
 (0)