Forum Discussion
Store password in Windows credential manager and use it in Powershell
- Jan 05, 2017
We use a class which is available in the PnP Core module to use retrieve credentials from the Windows Credential Manager. That class you can find here :
This would require you to either rewrite that to PowerShell, or use the PnP Core assembly in your project (or simply copy over this class to your own binary PowerShell module code).
Alternatively you could install the PnP PowerShell cmdlets (install-module sharepointpnppowershellonline) and forget about all the other cmdlets and use:
Get-PnPStoredCredential -Name "nameofthecredential" -Type PSCredential
Sorry, i can't answer that question. Maybe Erwin van Hunen can provide some additional insight about how to use this approach with other modules.
- Jan 05, 2017
We use a class which is available in the PnP Core module to use retrieve credentials from the Windows Credential Manager. That class you can find here :
This would require you to either rewrite that to PowerShell, or use the PnP Core assembly in your project (or simply copy over this class to your own binary PowerShell module code).
Alternatively you could install the PnP PowerShell cmdlets (install-module sharepointpnppowershellonline) and forget about all the other cmdlets and use:
Get-PnPStoredCredential -Name "nameofthecredential" -Type PSCredential
- Heiko WatzJan 09, 2017Iron Contributor