diff --git a/.github/linters/.powershell-psscriptanalyzer.psd1 b/.github/linters/.powershell-psscriptanalyzer.psd1 index 81b68c08..648c2702 100644 --- a/.github/linters/.powershell-psscriptanalyzer.psd1 +++ b/.github/linters/.powershell-psscriptanalyzer.psd1 @@ -2,10 +2,10 @@ @{ #CustomRulePath='path\to\CustomRuleModule.psm1' #RecurseCustomRulePath='path\of\customrules' - Severity = @( - 'Error' - 'Warning' - ) + # Severity = @( + # 'Error' + # 'Warning' + # ) #IncludeDefaultRules=${true} ExcludeRules = @( 'PSMissingModuleManifestField' diff --git a/src/completers.ps1 b/src/completers.ps1 index 75453f6f..1b742bed 100644 --- a/src/completers.ps1 +++ b/src/completers.ps1 @@ -6,12 +6,3 @@ [System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name) } } - -Register-ArgumentCompleter -CommandName Set-GitHubConfig, Get-GitHubConfig, Remove-GitHubConfig -ParameterName Name -ScriptBlock { - param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) - $null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter - - ([GitHubConfig]).GetProperties().Name | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_ ) - } -} diff --git a/src/functions/public/Auth/completers.ps1 b/src/functions/public/Auth/Connect-GitHubApp_completer.ps1 similarity index 100% rename from src/functions/public/Auth/completers.ps1 rename to src/functions/public/Auth/Connect-GitHubApp_completer.ps1 diff --git a/src/functions/public/Auth/Context/Get-GitHubContext.ps1 b/src/functions/public/Auth/Context/Get-GitHubContext.ps1 index 1a29f1a7..0dd8244b 100644 --- a/src/functions/public/Auth/Context/Get-GitHubContext.ps1 +++ b/src/functions/public/Auth/Context/Get-GitHubContext.ps1 @@ -68,8 +68,6 @@ function Get-GitHubContext { $contextObj = $_ Write-Verbose 'Context:' $contextObj | Select-Object * | Out-String -Stream | ForEach-Object { Write-Verbose $_ } - Write-Verbose 'Token splatt:' - Write-Verbose ($contextObj.Token | ConvertFrom-SecureString -AsPlainText) Write-Verbose "Converting to: [$($contextObj.Type)GitHubContext]" switch ($contextObj.Type) { diff --git a/src/functions/public/Auth/Context/Set-GitHubContext.ps1 b/src/functions/public/Auth/Context/Set-GitHubContext.ps1 index f331970a..e05ca2b6 100644 --- a/src/functions/public/Auth/Context/Set-GitHubContext.ps1 +++ b/src/functions/public/Auth/Context/Set-GitHubContext.ps1 @@ -47,9 +47,6 @@ function Set-GitHubContext { Write-Verbose 'Context:' $Context | Out-String -Stream | ForEach-Object { Write-Verbose $_ } - Write-Verbose "Token splatt:" - Write-Verbose ($Context.Token | ConvertFrom-SecureString -AsPlainText) - # Run functions to get info on the temporary context. try { Write-Verbose "Getting info on the context [$($Context['AuthType'])]." @@ -96,16 +93,10 @@ function Set-GitHubContext { $Context | Out-String -Stream | ForEach-Object { Write-Verbose $_ } if ($PSCmdlet.ShouldProcess('Context', 'Set')) { - Write-Verbose 'Token splatt:' - Write-Verbose ($Context.Token | ConvertFrom-SecureString -AsPlainText) Set-Context -ID "$($script:GitHub.Config.ID)/$($Context['Name'])" -Context $Context - Write-Verbose 'Token splatt:' - Write-Verbose ($Context.Token | ConvertFrom-SecureString -AsPlainText) if ($Default) { Set-GitHubDefaultContext -Context $Context['Name'] if ($Context['AuthType'] -eq 'IAT' -and $script:GitHub.EnvironmentType -eq 'GHA') { - Write-Verbose "Token splatt:" - $Context.Token | ConvertFrom-SecureString -AsPlainText | ForEach-Object { Write-Verbose "Token: $_" } Set-GitHubGitConfig -Context $Context['Name'] } } diff --git a/src/functions/public/Auth/Context/Set-GitHubDefaultContext.ps1 b/src/functions/public/Auth/Context/Set-GitHubDefaultContext.ps1 index 1e9afc47..82a51d3b 100644 --- a/src/functions/public/Auth/Context/Set-GitHubDefaultContext.ps1 +++ b/src/functions/public/Auth/Context/Set-GitHubDefaultContext.ps1 @@ -24,8 +24,6 @@ } process { - Write-Verbose 'Token splatt:' - $Context.Token | ConvertFrom-SecureString -AsPlainText | ForEach-Object { Write-Verbose "Token: $_" } if ($PSCmdlet.ShouldProcess("$Context", 'Set default context')) { Set-GitHubConfig -Name 'DefaultContext' -Value $Context.Name } diff --git a/src/functions/public/Config/completers.ps1 b/src/functions/public/Config/completers.ps1 new file mode 100644 index 00000000..32565af1 --- /dev/null +++ b/src/functions/public/Config/completers.ps1 @@ -0,0 +1,8 @@ +Register-ArgumentCompleter -CommandName Set-GitHubConfig, Get-GitHubConfig, Remove-GitHubConfig -ParameterName Name -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter + + ([GitHubConfig]).GetProperties().Name | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_ ) + } +} diff --git a/src/functions/public/Git/Set-GitHubGitConfig.ps1 b/src/functions/public/Git/Set-GitHubGitConfig.ps1 index 19caf64a..ef13448f 100644 --- a/src/functions/public/Git/Set-GitHubGitConfig.ps1 +++ b/src/functions/public/Git/Set-GitHubGitConfig.ps1 @@ -36,15 +36,9 @@ throw 'Git is not installed. Please install Git before running this command.' } - Write-Verbose 'Token splatt:' - $Context.Token | ConvertFrom-SecureString -AsPlainText | ForEach-Object { Write-Verbose "Token: $_" } - - $username = $Context.UserName $id = $Context.DatabaseID - Write-Verbose "Context.Token: [$($Context.Token)]" $token = $Context.Token | ConvertFrom-SecureString -AsPlainText - Write-Verbose "token: [$($token)]" $hostName = $Context.HostName if ($PSCmdlet.ShouldProcess("$Name", 'Set Git configuration')) {