-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(searchHubber): implement search functionality for hubbers by Name or Handle #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…bers by Name or Handle
|
|
||
| [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments','',Scope='function')] | ||
| $WarningParameters = @{ | ||
| WarningAction = 'SilentlyContinue' |
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
|
|
||
| $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
| 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
| Mock_Database | ||
|
|
||
| Start-MyTranscript | ||
| $result = search-Hubber @ErrorParameters |
Check warning
Code scanning / PSScriptAnalyzer
The variable 'result' is assigned but never used. Warning
| [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
| [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
| @@ -0,0 +1,29 @@ | |||
| function Search-Hubber { | |||
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Search-Hubber' does not have a help comment. Note
|
|
||
| $isName = -not [string]::IsNullOrEmpty($Name) | ||
| $isHandle = -not [string]::IsNullOrEmpty($Handle) | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| Write-MyError -Message "Please specify either Name or Handle, or both." | ||
| return $null | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
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.