fix Test-CredentialStoreItem return (#66)
All checks were successful
continuous-integration/drone/push Build is passing

#### 📖 Summary

- `Test-CredentialStoreItem` now returns `$false` and not a terminating error if store doesn't exists.
- Updates platyPS generated docs

#### 📑 Test Plan

> 💡 Select your test plan for the code changes.

- [x] Tested via Drone.io pipeline
- [ ] Custom test
- [ ] No test plan

##### Details / Justification

<!-- Add your test details or justification for missing tests here. -->

#### 📚 Additional Notes

- fixes #50

Co-authored-by: OCram85 <marco.blessing@googlemail.com>
Reviewed-on: #66
This commit is contained in:
OCram85 2022-07-19 11:46:21 +02:00
parent ae62cccfaa
commit b76668c1e7
19 changed files with 2057 additions and 2022 deletions

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---
@ -23,7 +24,15 @@ Defines the certificate related properties for an upcoming New-PfxCertificate ex
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-CSCertAttribute -Country 'DE' -State 'BW' -City 'Karlsruhe' -Organization 'AwesomeIT' -OrganizationalUnitName '' -CommonName 'MyPrivateCert' $AttribParams = @{
Country = 'DE'
State = 'BW'
City = 'Karlsruhe'
Organization ='AwesomeIT'
OrganizationalUnitName ='PSCredentialStore'
CommonName ='MyPrivateCert'
}
New-CSCertAttribute @AttribParams
``` ```
## PARAMETERS ## PARAMETERS

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---
@ -123,8 +124,8 @@ Accept wildcard characters: False
### -SkipPFXCertCreation ### -SkipPFXCertCreation
You can skip the pfx certificate creation process. You can skip the pfx certificate creation process.
This makes sense if you have a previously created cert or want to This makes sense if you have a previously created cert
import a cert in cross-platform environments. or want to import a cert in cross-platform environments.
```yaml ```yaml
Type: SwitchParameter Type: SwitchParameter
@ -139,10 +140,10 @@ Accept wildcard characters: False
``` ```
### -UseCertStore ### -UseCertStore
Instead of using a plain pfx file beside your CredentialStore file you can import it into the user or machine Instead of using a plain pfx file beside your CredentialStore file you can import it into the user or
certificate store. machine certificate store.
In this case the system itself secures the cert and you don't hat to set custom NTFS In this case the system itself secures the cert and you don't hat to set custom
permissions so secure your shared certificate. NTFS permissions so secure your shared certificate.
```yaml ```yaml
Type: SwitchParameter Type: SwitchParameter

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,14 +1,14 @@
--- ---
Module Name: PSCredentialStore Module Name: PSCredentialStore
Module Guid: 6800e192-9df8-4e30-b253-eb2c799bbe84 6800e192-9df8-4e30-b253-eb2c799bbe84 Module Guid: 6800e192-9df8-4e30-b253-eb2c799bbe84
Download Help Link: {{ Update Download Link }} Download Help Link: {{ Update Download Link }}
Help Version: {{ Please enter version of help manually (X.X.X.X) format }} Help Version: {{ Update Help Version }}
Locale: en-US Locale: en-US
--- ---
# PSCredentialStore Module # PSCredentialStore Module
## Description ## Description
{{ Fill in the Description }} See global Readme file for usage instructions.
## PSCredentialStore Cmdlets ## PSCredentialStore Cmdlets
### [Connect-To](Connect-To.md) ### [Connect-To](Connect-To.md)

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---
@ -27,6 +28,12 @@ Use this cmdlet for basic checks with a single item.
Check the item first with this function before Check the item first with this function before
you try to interact with it. you try to interact with it.
> :bulb: Breaking Change for \`v1.1.0+\`:
>
> Test-CredentialStoreItem will return \`$false\` even if the store doesn't exist.
> We removed the terminating
> error and replaced it with a warning message.
## EXAMPLES ## EXAMPLES
### EXAMPLE 1 ### EXAMPLE 1

View File

@ -1,6 +1,7 @@
--- ---
external help file: PSCredentialStore-help.xml external help file: ModuleRoot-help.xml
Module Name: PSCredentialStore Module Name: PSCredentialStore
online version:
schema: 2.0.0 schema: 2.0.0
--- ---

View File

@ -7,6 +7,10 @@ function Test-CredentialStoreItem {
Use this cmdlet for basic checks with a single item. Check the item first with this function before Use this cmdlet for basic checks with a single item. Check the item first with this function before
you try to interact with it. you try to interact with it.
Breaking Change for `v1.1.0+`:
Test-CredentialStoreItem will return `$false` even if the store doesn't exist. We removed the terminating
error and replaced it with a warning message.
.PARAMETER Path .PARAMETER Path
Define a custom credential store you try to read from. Without the `-Path` parameter Define a custom credential store you try to read from. Without the `-Path` parameter
`Test-CredentialStoreItem` tries to read from the default private store. `Test-CredentialStoreItem` tries to read from the default private store.
@ -88,10 +92,10 @@ function Test-CredentialStoreItem {
} }
else { else {
$MsgParams = @{ $MsgParams = @{
ErrorAction = 'Stop' Message = "The given credential store ({0}) does not exist!" -f $Path
Message = "The given credential store ({0}) does not exist!" -f $Path
} }
Write-Error @MsgParams Write-Warning @MsgParams
return $false
} }
} }