Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Publish version 1.0.x (#45)
Browse files Browse the repository at this point in the history
## About

## Content (Micro Commits)

* fixes #38 
* fixes #44 
* Implement precise lookup hierarchy (fixes #43)
* align pester test with #43 logic
* split cert functions
* use new cert functions for save an lookup
* fix pester tests
* [wip]
* fix var name ref
* fix exports
* fix cert store location for windows shared mode
* fix mandatory params
* fix accidentially removed code block
* add basic cert pester pests
* remove old docs
* update cbh blocks
* update cbh blocks
* update docs
* move .net wrapper forpfx files
* do not export .net wrapper functions
* update docs
* rename tests
* fix private functions location
* - fixes #44: FTP connection
* add link to reference
* add format files
* add preview version shield
* update markdown help files (platyps)
* add emoji images in captions
* fix typos
* fix typos
* fix typo
* prepare version numbers
  • Loading branch information
OCram85 authored Apr 29, 2019
1 parent d92d963 commit fdc6651
Show file tree
Hide file tree
Showing 55 changed files with 1,584 additions and 661 deletions.
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
[![AppVeyor branch](https://img.shields.io/appveyor/ci/OCram85/PSCredentialStore/master.svg?style=plastic "Master Banch Build Status")](https://ci.appveyor.com/project/OCram85/pscredentialstore/branch/master)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/OCram85/PSCredentialStore/master.svg?style=plastic "Master Branch Build Status")](https://ci.appveyor.com/project/OCram85/pscredentialstore/branch/master)
[![AppVeyor tests branch](https://img.shields.io/appveyor/tests/OCram85/PSCredentialStore/master.svg?style=plastic "Pester Tests Results")](https://ci.appveyor.com/project/OCram85/pscredentialstore/branch/master/tests)
[![Coveralls github](https://img.shields.io/coveralls/github/OCram85/PSCredentialStore.svg?style=plastic "Coveralls.io Coverage Report")](https://coveralls.io/github/OCram85/PSCredentialStore?branch=master)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/PSCredentialStore.svg?style=plastic "PowershellGallery Published Version")](https://www.powershellgallery.com/packages/PSCredentialStore)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/vpre/PSCredentialStore.svg?label=latest%20preview&style=plastic "PowershellGallery Latest Preview Version")](https://www.powershellgallery.com/packages/PSCredentialStore)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/PSCredentialStore.svg?style=plastic "PowershellGallery Downloads")](https://www.powershellgallery.com/packages/PSCredentialStore)

![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)
![forthebadge](http://forthebadge.com/images/badges/for-you.svg)

General
:key: General
=======

The PSCredentialStore is a simple credential manager for PSCredentials. It stores PSCredentials in a simple json
The PSCredentialStore is a simple credential manager for `PSCredential` objects. It stores PSCredentials in a simple json
file. You can choose between a private and shared credential store. The private one exists in your profile and can
ony accessed by your account on the same machine. The shared store enables you to use different credentials for your
scripts without exposing them as plain text.

**The shared store isn't 100% secure and I don't recommend using it in production!**

PSCredentialStore was developed to simplify the delegation of complex powershell scripts. In this case you often
need to store credentials for non interactive usage like in scheduled tasks.

Starting with version `1.0.0` PSCredential uses Pfx certificates fo encryption. You can use Pfx certificate files
or certificates stored in the certificate store.

For more details read the [about_PSCredentialStore](/docs/about_PSCredentialStore.md) page on github or via CLI with
`Get-Help about_PSCredentialStore`.

:exclamation: Upcoming Changes :exclamation:
================
You can find the [reference](/docs/PSCredentialStore.md) in the /docs/ path as well.

The will be some breaking changes starting with the `0.5.0.xxx`:
:vulcan_salute: Requirements
============

- **PSCredentialStore will use PFX certificates to encrypt your credentials.**
- This replaces the the current encryption methods and you need to recreate or upgrade your pre existing stores.
- The changes allows the PSCredentialStore module to support the PowerShell `Core` editions.
- Yes this means, you can use the module on any PowerShell 6 supported linux distribution.
- It's also possible to create a shared credential store and transfer it onto a another platform like:
`Windows -- to --> Linux` and vice versa.
- Automatically creates self signed certificate with 2048 bits RSA keys for encryption.
- PowerShell >= `5.1`
- .NET Framework >= `4.6` or .NET Core >= `1.0`

Installation
:hammer_and_wrench: Installation
============

PowerShellGallery.com (Recommended Way)
:artificial_satellite: PowerShellGallery.com (Recommended Way)
---------------------------------------

* Make sure you use PowerShell 5.1 or higher with `$PSVersionTable`.
* Use the builtin PackageManagement and install with: `Import-Module PowerShellGet; Install-Module 'PSCredentialStore' -Repository 'PSGallery'`
* Additionally use the `-AllowPrerelease` switch until we publish the final release!
* Done. Start exploring the Module with `Import-Module PSCredentialStore ; Get-Command -Module PSCredentialStore`

Manual Way
:building_construction: Manual Way
----------

* Take a look at the [Latest Release](https://github.com/OCram85/PSCredentialStore/releases/latest) page.
Expand All @@ -56,19 +53,27 @@ Manual Way
* Don't forget to change the NTFS permission flag in the context menu.
* Start with `Import-Module PSCredentialStore`

Quick Start
:sparkles: Quick Start
-----------

**1.** First we need a blank credential store. You can decide between a *private* or *shared* store. The private
Credential Store can only be accessed with your profile on the machine you created it.

Starting with version `1.0.0` you can decide the storage type of your fresh created certificate. As default
PSCredentialStore creates a new pfx certificate file beside the credential store itself. Optionally you can provide
the parameter `-UseCertStore`. This imports the new certificate in the user or machine certificate store as well.

```powershell
# Private credential store
New-CredentialStore
# Shared credential rtore
# Private credential store with certificate store usage
New-CredentialStore -UseCertStore
# Shared credential store
New-CredentialStore -Shared
#Shared credential store in custom Location
#Shared credential store in custom location
New-CredentialStore -Shared -Path 'C:\CredentialStore.json'
```

Expand Down Expand Up @@ -110,14 +115,17 @@ Connect-To -RemoteHost "ftp.myside.local" -Type FTP
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
Connect-To -RemoteHost "vcr.myside.local" -Type CisServer
Connect-To -RemoteHost "exchange1.myside.local" -Type ExchangeHTTP
Connect-To -RemoteHost "exchange1.myside.local" -Type ExchangeHTTPS
Connect-To -RemoteHost "ubuntu.myside.local" -Type SCP
```

Credits
:pushpin: Credits
-------

A huge thanks to all the people who helped with their projects and indirect contributions which made this possible!

- This module is inspired by the awesome work of @dlwyatt with articles like these:
- This module is inspired by the awesome work of Dave Wyatt ([@dlwyatt](https://github.com/dlwyatt)) with articles like these:
- https://powershell.org/2013/11/24/saving-passwords-and-preventing-other-processes-from-decrypting-them/
- https://powershell.org/2014/02/01/revisited-powershell-and-encryption/
- The awesome people from [LibreSSL](http://www.libressl.org/) which publishes the [portable openssl/libressl binaries](https://github.com/libressl-portable/portable)!
5 changes: 1 addition & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# release version:
#version: 0.5.0.{build}

# pre release version:
version: 0.5.{build}
version: 1.0.{build}

#branches:
# only:
Expand Down
56 changes: 31 additions & 25 deletions docs/Connect-To.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
external help file: PSCredentialStore-help.xml
Module Name: PSCredentialStore
online version: https://github.com/OCram85/PSCredentialStore
schema: 2.0.0
---

# Connect-To

## SYNOPSIS
Expand All @@ -14,52 +7,52 @@ Connects to the given host using the stored CredentialStoreItem.

### Private (Default)
```
Connect-To -RemoteHost <String> [-Identifier <String>] -Type <String> [-Credentials <PSCredential>]
Connect-To -RemoteHost <String> [-Identifier <String>] -Type <String> [-Credentials <PSCredential>] [-PassThru]
[<CommonParameters>]
```

### Shared
```
Connect-To -RemoteHost <String> [-Identifier <String>] -Type <String> [-Credentials <PSCredential>]
[-Path <String>] [-Shared] [<CommonParameters>]
Connect-To -RemoteHost <String> [-Identifier <String>] -Type <String> [-Credentials <PSCredential>] [-Shared]
[-Path <String>] [-PassThru] [<CommonParameters>]
```

## DESCRIPTION
Establish a connection to the selected host using a stored CredentialStoreItem.

## EXAMPLES

### EXAMPLE 1
### BEISPIEL 1
```
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
```

### EXAMPLE 2
### BEISPIEL 2
```
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
```

### EXAMPLE 3
### BEISPIEL 3
```
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
```

### EXAMPLE 4
### BEISPIEL 4
```
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
```

### EXAMPLE 5
### BEISPIEL 5
```
Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer
```

### EXAMPLE 6
### BEISPIEL 6
```
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTP
```

### EXAMPLE 7
### BEISPIEL 7
```
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTPS
```
Expand Down Expand Up @@ -102,6 +95,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -PassThru
Returns the value from the underlying connection type function.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Path
Define a custom path to a shared CredentialStore.
Expand All @@ -112,7 +120,7 @@ Aliases:

Required: False
Position: Named
Default value: "{0}\PSCredentialStore\CredentialStore.json" -f $env:ProgramData
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down Expand Up @@ -142,7 +150,7 @@ Type: SwitchParameter
Parameter Sets: Shared
Aliases:

Required: False
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Expand All @@ -167,20 +175,18 @@ Accept wildcard characters: False
```
### CommonParameters
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).
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).
## INPUTS
### [None]
## OUTPUTS
### [None]
## NOTES
File Name : Connect-To.ps1
Author : Marco Blessing - [email protected]
Requires :
- File Name : Connect-To.ps1
- Author : Marco Blessing - [email protected]
- Requires :
## RELATED LINKS
Expand Down
33 changes: 12 additions & 21 deletions docs/Disconnect-From.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
external help file: PSCredentialStore-help.xml
Module Name: PSCredentialStore
online version: https://github.com/OCram85/PSCredentialStore
schema: 2.0.0
---

# Disconnect-From

## SYNOPSIS
Expand All @@ -21,42 +14,42 @@ Terminates a session established with Connect-To using a CredentialStoreItem.

## EXAMPLES

### EXAMPLE 1
### BEISPIEL 1
```
Disconnect-From -RemoteHost "ucs.myside.local" -Type CiscoUcs
```

### EXAMPLE 2
### BEISPIEL 2
```
Disconnect-From -RemoteHost "ftp.myside.local" -Type FTP
```

### EXAMPLE 3
### BEISPIEL 3
```
Disconnect-From -RemoteHost "fas.myside.local" -Type NetAppFAS
```

### EXAMPLE 4
### BEISPIEL 4
```
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware
```

### EXAMPLE 5
### BEISPIEL 5
```
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware -Force:$True
```

### EXAMPLE 6
### BEISPIEL 6
```
Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer
```

### EXAMPLE 7
### BEISPIEL 7
```
Disconnect-From -RemoteHost "exchange01.myside.local" -Type ExchangeHTTP
```

### EXAMPLE 8
### BEISPIEL 8
```
Disconnect-From -RemoteHost "exchange01.myside.local" -Type ExchangeHTTPS
```
Expand Down Expand Up @@ -111,20 +104,18 @@ Accept wildcard characters: False
```
### CommonParameters
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).
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).
## INPUTS
### [None]
## OUTPUTS
### [None]
## NOTES
File Name : Disconnect-From.ps1
Author : Marco Blessing - [email protected]
Requires :
- File Name : Disconnect-From.ps1
- Author : Marco Blessing - [email protected]
- Requires :
## RELATED LINKS
Expand Down
Loading

0 comments on commit fdc6651

Please sign in to comment.