Skip to content

Commit

Permalink
(#160) Brings Set-*Cert Scripts Into Consistancy
Browse files Browse the repository at this point in the history
Adds an argument completer for thumbprint, standardises on Thumbprint and Port as arguments.
  • Loading branch information
JPRuskin committed Jun 17, 2024
1 parent 051c0d1 commit 94ba8d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
15 changes: 12 additions & 3 deletions scripts/Set-CCMCert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ Thumbprint value of the certificate you would like the Chocolatey Central Manage
Please make sure the certificate is located in both the Cert:\LocalMachine\TrustedPeople\ and Cert:\LocalMachine\My certificate stores.
.EXAMPLE
PS> .\Set-CCMCert.ps1 -CertificateThumbprint 'Your_Certificate_Thumbprint_Value'
PS> .\Set-CCMCert.ps1 -Thumbprint 'Your_Certificate_Thumbprint_Value'
#>

[CmdletBinding()]
param(
[Parameter(Mandatory)]
[String]
$CertificateThumbprint
[ArgumentCompleter({
Get-ChildItem Cert:\LocalMachine\My | ForEach-Object {
[System.Management.Automation.CompletionResult]::new(
$_.Thumbprint,
$_.Thumbprint,
'ParameterValue',
$_.FriendlyName
)
}
})]
[string]$Thumbprint
)

begin {
Expand Down
10 changes: 10 additions & 0 deletions scripts/Set-JenkinsCert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
param(
# Thumbprint of the certificate stored in the Trusted People cert-store.
[Parameter(Mandatory)]
[ArgumentCompleter({
Get-ChildItem Cert:\LocalMachine\My | ForEach-Object {
[System.Management.Automation.CompletionResult]::new(
$_.Thumbprint,
$_.Thumbprint,
'ParameterValue',
$_.FriendlyName
)
}
})]
[string]$Thumbprint,

# Port number to use for Jenkins HTTPS.
Expand Down
14 changes: 11 additions & 3 deletions scripts/Set-NexusCert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ Thumbprint value of certificate you want to run Nexus on. Make sure certificate
Port you have Nexus configured to run on.
.EXAMPLE
PS> .\Set-NexusCert.ps1 -Thumbprint 'Your_Certificate_Thumbprint_Value' -NexusPort 'Port_Number'
PS> .\Set-NexusCert.ps1 -Thumbprint 'Your_Certificate_Thumbprint_Value' -Port 'Port_Number'
#>

[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]
$Thumbprint,
[ArgumentCompleter({
Get-ChildItem Cert:\LocalMachine\My | ForEach-Object {
[System.Management.Automation.CompletionResult]::new(
$_.Thumbprint,
$_.Thumbprint,
'ParameterValue',
$_.FriendlyName
)
}
})]
[string]$Thumbprint,

[Parameter()]
Expand Down

0 comments on commit 94ba8d4

Please sign in to comment.