private PSRepositoryInfo PSGalleryParameterSetHelper(int repoPriority, bool repoTrusted)
        {
            Uri psGalleryUri = new Uri(PSGalleryRepoUri);

            WriteVerbose("(PSGallerySet) internal name and uri values for Add() API are hardcoded and validated, priority and trusted values, if passed in, also validated");
            var addedRepo = RepositorySettings.AddToRepositoryStore(PSGalleryRepoName,
                                                                    psGalleryUri,
                                                                    repoPriority,
                                                                    repoTrusted,
                                                                    repoCredentialInfo: null,
                                                                    Force,
                                                                    this,
                                                                    out string errorMsg);

            if (!string.IsNullOrEmpty(errorMsg))
            {
                ThrowTerminatingError(new ErrorRecord(
                                          new PSInvalidOperationException(errorMsg),
                                          "RepositoryCredentialSecretManagementUnavailableModule",
                                          ErrorCategory.ResourceUnavailable,
                                          this));
            }

            return(addedRepo);
        }