Skip to content

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Oct 1, 2025

Introduce the Search-Hubber function to allow querying hubbers based on their Name or Handle. Update the Get-Hubber function to enhance parameter handling. Add unit tests to validate the search functionality across various scenarios.


[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments','',Scope='function')]
$WarningParameters = @{
WarningAction = 'SilentlyContinue'

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

$TEST_TRANSCRIPT_FILE = "test_transcript.log"

function Start-MyTranscript {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Start-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Start-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
Start-Transcript -Path $TEST_TRANSCRIPT_FILE
}

function Stop-MyTranscript {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Stop-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Stop-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
Mock_Database

Start-MyTranscript
$result = search-Hubber @ErrorParameters

Check warning

Code scanning / PSScriptAnalyzer

The variable 'result' is assigned but never used. Warning

The variable 'result' is assigned but never used.
[CmdletBinding()]
param (
[Parameter(Position=0)][string]$Handle,
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName,Position=0)][string]$Handle,

Check warning

Code scanning / PSScriptAnalyzer

Command accepts pipeline input but has not defined a process block. Warning

Command accepts pipeline input but has not defined a process block.
[CmdletBinding()]
param (
[Parameter(Position=0)][string]$Handle,
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName,Position=0)][string]$Handle,

Check warning

Code scanning / PSScriptAnalyzer

Command accepts pipeline input but has not defined a process block. Warning

Command accepts pipeline input but has not defined a process block.
@@ -0,0 +1,29 @@
function Search-Hubber {

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Search-Hubber' does not have a help comment. Note

The cmdlet 'Search-Hubber' does not have a help comment.

$isName = -not [string]::IsNullOrEmpty($Name)
$isHandle = -not [string]::IsNullOrEmpty($Handle)

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
Write-MyError -Message "Please specify either Name or Handle, or both."
return $null
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg rulasg merged commit 5da7509 into main Oct 1, 2025
3 checks passed
@rulasg rulasg deleted the search-hubber branch October 1, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants