Skip to content
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

Unexpected output from Get-CVJob function if the -ClientName parameter is a non-existent client name #19

Closed
AnthonyHodges opened this issue Jan 5, 2021 · 1 comment

Comments

@AnthonyHodges
Copy link

PowerShell Module: Commvault.JobManager.psm1
Module Generated on: 5/22/2019
Function: Get-CVJob
Parameter: ClientName
Parameter Value: 'Any Client Name Not Found In CommCell'
Unexpected Output: "INFO: Get-CVClient: client not found having name [Any Client Name Not Found In CommCell]" followed by a summary of all the jobs not filtered out from other parameters
Expected Output: "INFO: Get-CVClient: client not found having name [Any Client Name Not Found In CommCell]" only

Code Issue Location: Line 174

            if (-not [String]::IsNullOrEmpty($ClientName)) {
                $clientObj = Get-CVClient -Client $ClientName
                if ($null -ne $clientObj) { 
                    $sessionObj.requestProps.endpoint += '&clientId=' + $clientObj.clientId
                }
            }

Suggested Edit:

             if (-not [String]::IsNullOrEmpty($ClientName)) {
                $clientObj = Get-CVClient -Client $ClientName
                if ($null -ne $clientObj) { 
                    $sessionObj.requestProps.endpoint += '&clientId=' + $clientObj.clientId
                }
                else {
                    return
                }
            }

Thanks to JMH_ML from Commvault Forums 'http://forum.commvault.com/forums/AddPost.aspx?PostID=67531' who discovered this issue.

@ypolishetty
Copy link
Collaborator

ypolishetty commented Mar 1, 2021

@AnthonyHodges This is now fixed with the below pull request. Thanks for reporting.
#21

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

No branches or pull requests

2 participants