Marco Blessing
64af16cc08
* adds basic module layout * fix module manifest encoding * fix callsign in appveyor helper * adds challenge file related functions * adds connection manager functions * adds Test-ChallengeFile * adds item related functions * adds store related functions * adds cSpell dictionary * adds CredentialStore related Pester tests * [WIP] test Pester file * fix typo * adds file dependencies * [WIP] fix pester tests * fix exception state * [WIP] add file dependencies * fix gitkeep filename * set constant debug module version string * adds Pester Tests for New-CredentialStoreItem * adds basic readme file * adds functions to export; adds meta data * adds vscode debug config * adds test for optional dependencies * [WIP] Implements optional dependency test * adds taskrunner definitions * adds CBH * add gitignore file * adds basic Build tasks * typo fixed * adds build folder to ignore list * adds Cisco and NetApp opt dependencies * adds build task * fix end of line dequence * remove task.json error * adds sources for optional modules * enables Pester and posh-git * prepare pre-release |
||
---|---|---|
.vscode | ||
bin | ||
resources | ||
src | ||
tests | ||
tools | ||
.gitignore | ||
appveyor.yml | ||
LICENSE | ||
README.md |
AppVeyor Overall | AppVeyor Master | AppVeyor Dev | Coveralls.io | Download |
---|---|---|---|---|
General
The PSCredentialStore is an simple credential manager for PSCredentials. It stores multiple credential objects in a simple json file. You can choose between a private and shared 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 script 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.
To get started read the about_PSCredentialStore page.
Installation
PowerShellGallery.com (Recommended Way)
- Make sure you use PowerShell 4.0 or higher with
$PSVersionTable
. - Use the builtin PackageManagement and install with:
Install-Module PSCredentialStore
- Done. Start exploring the Module with
Import-Module PSCredentialStore ; Get-Command -Module PSCredentialStore
Manual Way
- Take a look at the Latest Release page.
- Download the
PSCredentialStore.zip
. - Unpack the Zip and put it in your Powershell Module path.
- Don't forget to change the NTFS permission flag in the context menu.
- Start with
Import-Module PSCredentialStore
Quick Start
1. First we need a blank CredentialStore. 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.
# Private Credential Store
New-CredentialStore
# Shared Credential Store
New-CredentialStore -Shared
#Shared CredentialStore in custom Location
New-CredentialStore -Shared -Path 'C:\CredentialStore.json'
2. Now you can manage your CredentialStoreItems:
# This will prompt for credentials and stores it in a private store
New-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD'
# You can now use it in other scripts like this:
$DCCreds = Get-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD'
Invoke-Command -ComputerName 'dc01.myside.local' -Credential $DCCreds -ScripBlock {Get-Process}
The CredentialStore contains also a simple function to establish a connection with several systems or protocols. If you have already installed the underlying framework your can connect to:
- CiscoUcs - Establish a connection to a Cisco UCS fabric interconnect.
- Required Modules:
Cisco.UCS.Core
,Cisco.UCSManager
- Required Modules:
- FTP - Establish a connection to a FTP host.
- Required Modules:
WinSCP
- Required Modules:
- NetAppFAS - Establish a connection to a NetApp Clustered ONTAP filer.
- Required Modules:
DataONTAP
- Required Modules:
- VMware - Establish a connection to a VMware vCenter or ESXi host.
- Required Modules:
VMware.VimAutomation.Core
- Required Modules:
Here are some basic examples:
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
Connect-To -RemoteHost "esx01.myside.local" -Type VMware