Windows 8 Store App style Windows Credential Management Module for Windows PowerShell
PowerShell Shell
Latest commit 2701067 Jan 19, 2015 @guitarrapc Define output Type
Failed to load latest commit information.
Images Add Image Jan 19, 2015
WindowsCredentialVault Define output Type Jan 19, 2015
.gitattributes Add Solutions, REadMe Jan 19, 2015
.gitignore Add Solutions, REadMe Jan 19, 2015
LICENSE Add Solutions, REadMe Jan 19, 2015 Add Image Jan 19, 2015
WindowsCredentialVault.sln Add Solutions, REadMe Jan 19, 2015


What this for?

This module allows you to handle your credential with Windows Credential Manager.

It used to be requires P/Invoke to handle Windows Credential Manager. > PInvoke.Net

However there are PasswordVault class for Windows 8 StoreApops in .NET framework and it allows not only StoreApps but also PowerShell to manage their Credential super easy.


Set Credential

Below sample code will save your Credential as hoge.

Set-WindowsCredential -ResourceName hoge -Credential (Get-Credential)

Get Credential

Get-WindowsCredential -ResourceName hoge

This retrieve all user credential for ResourceName 'hoge'.

UserName                                                                             Password
--------                                                                             --------
hoge                                                             System.Security.SecureString

You can specify username for the Resource.

Get-WindowsCredential -ResourceName hoge -UserName hoge

Want to retrieve all credentials? Use -All switch.

Get-WindowsCredential -All

Test Credential is exist

You can test if credential is exist or not.

Test-WindowsCredential -ResourceName hoge

If credential is exist then true will be return. If not false will return.

You can specify Resource and UserName.

Test-WindowsCredential -ResourceName hoge -UserName hoge

Remove Credential

You can remove credential.

Remove-WindowsCredential -ResourceName hoge -UserName hoge

If you want to remove all credential in ResourceName, then use -All switch.

Remove-WindowsCredential -ResourceName hoge -All


As PasswordVault use Windows.Security.Credentials.PasswordCredential, this module convert to/from PSCredential.


Convert PSCredential TO Windows.Security.Credentials.PasswordCredential.

ConvertTo-PasswordCredential -Credential (Get-Credential) -ResourceName hoge


Convert Windows.Security.Credentials.PasswordCredential to PSCredential.

ConvertFrom-PasswordCredential -Credential $Credential