Refactoring#78
Open
kostyanf14 wants to merge 14 commits into
Open
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Contributor
Author
|
/gemini review |
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
| } elseif ($toolsHCKlist.Contains($cmd)) { | ||
| try { | ||
| $commandInfo = Get-Command -Name $cmd -CommandType Function -ErrorAction Stop | ||
| $invokeArgs = @([string[]]@($cmdlinelist.ToArray())) |
Add Test-ToolsHCKHelpExit and Assert-ToolsHCKNonEmptyParam for the repeated interactive warning vs JSON throw patterns. Replace duplicated blocks across actions to shorten the script and keep behavior aligned. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Replace New-Object/Add-Member chains in New-* helpers with [pscustomobject]@{ }
for simpler JSON-oriented projection objects and smaller surface area.
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Use List[object]/List[string] with Add/AddRange instead of ArrayList, drop redundant Out-Null after Add where the API returns void, and initialize the action allowlist from a string array via the List constructor. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…InPool Centralize root pool and machine resolution with optional custom error text so delete/move/state flows keep their messages while other actions share the detailed pool/machine wording. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Replace repeated -band checks in parsescheduleoptions with iteration over the known DistributionOption flags and collect matching names into List[string]. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid two clock reads in gettimestamp so date and time strings always match the same instant. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Build the Studio connection file path from WTTSTDIO using Join-Path so a missing trailing separator does not break discovery. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Align New-ActionResult defaults and JSON error wrapping with PowerShell's built-in null so strict mode and readability stay correct. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Match the variable casing used when loading connect.xml for the database name. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
New-ActionResult now copies array-shaped ConvertFrom-Json output with @() instead of relying on SyncRoot, which is implementation-specific and easy to get wrong across PowerShell versions. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Replace exit -1 with exit 1 when DB connection or TCP bind fails so shells and automation see a conventional non-zero status. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Correct machine/state wording, target key labels, listmachinetargets typo, hasn't/Queues/information, and related usage strings. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Validate WTTSTDIO, resolve kit DLL paths with Join-Path, and surface load failures via Write-Error before exiting so missing Studio installs fail fast with a clear reason. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.