|
1 | | -# PSCredentialStore |
| 1 | +| AppVeyor Overall | AppVeyor Master | AppVeyor Dev | Coveralls.io | Download | |
| 2 | +| :--------------: | :-------------: | :----------: | :-----------: | :--------:| |
| 3 | +| [](https://ci.appveyor.com/project/OCram85/PSCredentialStore) | [](https://ci.appveyor.com/project/OCram85/PSCredentialStore/branch/master) | [](https://ci.appveyor.com/project/OCram85/PSCredentialStore/branch/dev) | [](https://coveralls.io/github/OCram85/PSCredentialStore?branch=master) | [](https://www.powershellgallery.com/packages/PSCredentialStore) |
| 4 | + |
| 5 | +General |
| 6 | +======= |
| 7 | + |
| 8 | +The PSCredentialStore is an simple credential manager for PSCredentials. It stores multiple credential objects in a |
| 9 | +simple json file. You can choose between a private and shared store. The private one exists in your profile and can |
| 10 | +ony accessed by your account on the same machine. The shared store enables you to use different credentials for your |
| 11 | +script without exposing them as plain text. |
| 12 | + |
| 13 | +**The shared store isn't 100% secure and I don't recommend using it in production!** |
| 14 | + |
| 15 | +PSCredentialStore was developed to simplify the delegation of complex powershell scripts. In this case you often |
| 16 | +need to store credentials for non interactive usage like in scheduled tasks. |
| 17 | + |
| 18 | +To get started read the [about_PSCredentialStore](/src/en-US/about_PSCredential.help.txt) page. |
| 19 | + |
| 20 | +Installation |
| 21 | +============ |
| 22 | + |
| 23 | +PowerShellGallery.com (Recommended Way) |
| 24 | +--------------------------------------- |
| 25 | + |
| 26 | +* Make sure you use PowerShell 4.0 or higher with `$PSVersionTable`. |
| 27 | +* Use the builtin PackageManagement and install with: `Install-Module PSCredentialStore` |
| 28 | +* Done. Start exploring the Module with `Import-Module PSCredentialStore ; Get-Command -Module PSCredentialStore` |
| 29 | + |
| 30 | +Manual Way |
| 31 | +---------- |
| 32 | + |
| 33 | +* Take a look at the [Latest Release](https://github.com/OCram85/PSCredentialStore/releases/latest) page. |
| 34 | +* Download the `PSCredentialStore.zip`. |
| 35 | +* Unpack the Zip and put it in your Powershell Module path. |
| 36 | + * Don't forget to change the NTFS permission flag in the context menu. |
| 37 | +* Start with `Import-Module PSCredentialStore` |
| 38 | + |
| 39 | +Quick Start |
| 40 | +----------- |
| 41 | + |
| 42 | +**1.** First we need a blank CredentialStore. You can decide between a *private* or *shared* store. The private |
| 43 | +Credential Store can only be accessed with your profile on the machine you created it. |
| 44 | +```powershell |
| 45 | +# Private Credential Store |
| 46 | +New-CredentialStore |
| 47 | +
|
| 48 | +# Shared Credential Store |
| 49 | +New-CredentialStore -Shared |
| 50 | +
|
| 51 | +#Shared CredentialStore in custom Location |
| 52 | +New-CredentialStore -Shared -Path 'C:\CredentialStore.json' |
| 53 | +``` |
| 54 | + |
| 55 | +**2.** Now you can manage your CredentialStoreItems: |
| 56 | +```powershell |
| 57 | +# This will prompt for credentials and stores it in a private store |
| 58 | +New-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD' |
| 59 | +
|
| 60 | +# You can now use it in other scripts like this: |
| 61 | +$DCCreds = Get-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD' |
| 62 | +Invoke-Command -ComputerName 'dc01.myside.local' -Credential $DCCreds -ScripBlock {Get-Process} |
| 63 | +``` |
| 64 | + |
| 65 | +The CredentialStore contains also a simple function to establish a connection with several systems or protocols. |
| 66 | +If you have already installed the underlying framework your can connect to: |
| 67 | + |
| 68 | +* **CiscoUcs** - Establish a connection to a Cisco UCS fabric interconnect. |
| 69 | + * Required Modules: [`Cisco.UCS.Core`, `Cisco.UCSManager`](https://software.cisco.com/download/release.html?i=!y&mdfid=286305108&softwareid=284574017&release=2.1.1) |
| 70 | +* **FTP** - Establish a connection to a FTP host. |
| 71 | + * Required Modules: [`WinSCP`](https://www.powershellgallery.com/packages/WinSCP) |
| 72 | +* **NetAppFAS** - Establish a connection to a NetApp Clustered ONTAP filer. |
| 73 | + * Required Modules: [`DataONTAP`](http://mysupport.netapp.com/tools/info/ECMLP2310788I.html?productID=61926) |
| 74 | +* **VMware** - Establish a connection to a VMware vCenter or ESXi host. |
| 75 | + * Required Modules: [`VMware.VimAutomation.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI) |
| 76 | + |
| 77 | +Here are some basic examples: |
| 78 | + |
| 79 | +```powershell |
| 80 | +Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs |
| 81 | +Connect-To -RemoteHost "ftp.myside.local" -Type FTP |
| 82 | +Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS |
| 83 | +Connect-To -RemoteHost "esx01.myside.local" -Type VMware |
| 84 | +``` |
0 commit comments