Enables pipeline input for -Credential parameter #25

Merged
OCram85 merged 5 commits from i19 into master 2018-03-21 14:32:32 +01:00
12 changed files with 58 additions and 78 deletions
Showing only changes of commit f6dc7b0108 - Show all commits

View File

@ -167,8 +167,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -111,8 +111,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -71,8 +71,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -101,8 +101,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -5,79 +5,56 @@ online version: https://github.com/OCram85/PSCredentialStore
schema: 2.0.0 schema: 2.0.0
--- ---
# New-CredentialStore # Get-CredentialStoreItem
## SYNOPSIS ## SYNOPSIS
Creates a new credential store File Returns the Credential from a given remote host item.
## SYNTAX ## SYNTAX
### Private (Default) ### Private (Default)
``` ```
New-CredentialStore [-Force] [<CommonParameters>] Get-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [<CommonParameters>]
``` ```
### Shared ### Shared
``` ```
New-CredentialStore [-Shared] [-Path <String>] [-Force] [<CommonParameters>] Get-CredentialStoreItem [-Path <String>] -RemoteHost <String> [-Identifier <String>] [-Shared]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
You need to run this script first to create a new credential store before you try to Return the credential as PSCredential object.
save new credentials with New-CredentialStoreItem.
## EXAMPLES ## EXAMPLES
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-CredentialStore $myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
``` ```
# Creates a new private CredentialStore
### EXAMPLE 2
```
New-CredentialStore -Force
```
# Resets an existing private CredentialStore
### EXAMPLE 3
```
New-CredentialStore -Shared
```
# Creates a new shared CredentialStore
### EXAMPLE 4
```
New-CredentialStore -Shared -Path "C:\TMP\CredentialStore.json"
```
# Creates a new shared CredentialStore in the given location.
## PARAMETERS ## PARAMETERS
### -Force ### -Identifier
Use this switch to reset an existing store. Provide a custom identifier to the given remote host key.
The complete content will be wiped. This enables you to store multiple credentials
for a single remote host entry.
For example ad/sys1, ftp/sys1, mssql/sys1
```yaml ```yaml
Type: SwitchParameter Type: String
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: Named Position: Named
Default value: False Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -Path ### -Path
Define a location for the new shared CredentialStore. Define a custom path to a shared CredentialStore.
The default store will be created in
$Env:ProgramData\PSCredentialStore dir.
```yaml ```yaml
Type: String Type: String
@ -91,11 +68,25 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -RemoteHost
Specify the host, for which you would like to change the credentials.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Shared ### -Shared
Creates a CredentialStore in the Shared mode. Switch to shared mode with this param.
This enables you to read the CredentialStore Items on This enforces the command to work with a shared CredentialStore which
different systems or profiles. can be decrypted across systems.
In addition you can optionally provide a custom path wit the -Path parameter.
```yaml ```yaml
Type: SwitchParameter Type: SwitchParameter
@ -110,8 +101,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS
@ -119,11 +109,11 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink
## OUTPUTS ## OUTPUTS
### [None] ### [System.Management.Automation.PSCredential]
## NOTES ## NOTES
\`\`\` \`\`\`
File Name : New-CredentialStore.ps1 File Name : Get-CredentialStoreItem.ps1
Author : Marco Blessing - marco.blessing@googlemail.com Author : Marco Blessing - marco.blessing@googlemail.com
Requires : Requires :
\`\`\` \`\`\`

View File

@ -119,8 +119,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -12,35 +12,35 @@ Locale: en-US
## PSCredentialStore Cmdlets ## PSCredentialStore Cmdlets
### [Connect-To](Connect-To.md) ### [Connect-To](Connect-To.md)
{{Manually Enter Connect-To Description Here}} Connects to the given host using the stored CredentialStoreItem.
### [Disconnect-From](Disconnect-From.md) ### [Disconnect-From](Disconnect-From.md)
{{Manually Enter Disconnect-From Description Here}} Terminates a session established with Connect-To using a CredentialStoreItem.
### [Get-CredentialStore](Get-CredentialStore.md) ### [Get-CredentialStore](Get-CredentialStore.md)
{{Manually Enter Get-CredentialStore Description Here}} Reads the complete content of the credential store and returns it as a new object.
### [Get-CredentialStoreItem](Get-CredentialStoreItem.md) ### [Get-CredentialStoreItem](Get-CredentialStoreItem.md)
{{Manually Enter Get-CredentialStoreItem Description Here}} Returns the Credential from a given remote host item.
### [New-CredentialStore](New-CredentialStore.md) ### [Get-CredentialStoreItem](Get-CredentialStoreItem.md)
{{Manually Enter New-CredentialStore Description Here}} Returns the Credential from a given remote host item.
### [New-CredentialStoreItem](New-CredentialStoreItem.md) ### [New-CredentialStoreItem](New-CredentialStoreItem.md)
{{Manually Enter New-CredentialStoreItem Description Here}} Adds a credential store item containing host, user and password to the given store.
### [Remove-CredentialStoreItem](Remove-CredentialStoreItem.md) ### [Remove-CredentialStoreItem](Remove-CredentialStoreItem.md)
{{Manually Enter Remove-CredentialStoreItem Description Here}} Remove the given credentials from the credential store.
### [Set-CredentialStoreItem](Set-CredentialStoreItem.md) ### [Set-CredentialStoreItem](Set-CredentialStoreItem.md)
{{Manually Enter Set-CredentialStoreItem Description Here}} Changes the credentials for the given remote host in the store.
### [Test-CredentialStore](Test-CredentialStore.md) ### [Test-CredentialStore](Test-CredentialStore.md)
{{Manually Enter Test-CredentialStore Description Here}} Returns the credential store state.
### [Test-CredentialStoreItem](Test-CredentialStoreItem.md) ### [Test-CredentialStoreItem](Test-CredentialStoreItem.md)
{{Manually Enter Test-CredentialStoreItem Description Here}} Checks if the given RemoteHost identifier combination exists in the credential store.
### [Test-CSConnection](Test-CSConnection.md) ### [Test-CSConnection](Test-CSConnection.md)
{{Manually Enter Test-CSConnection Description Here}} Returns the connection state of a given type to the remote host.

View File

@ -102,8 +102,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -102,8 +102,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -61,8 +61,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -71,8 +71,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS

View File

@ -110,8 +110,7 @@ Accept wildcard characters: False
``` ```
### CommonParameters ### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS ## INPUTS