using System.Management.Automation;
using (PowerShell powerShell = PowerShell.Create())
Install-Module -Name CredentialManager -Force -Scope CurrentUser
Import-Module CredentialManager
$credentials = Get-StoredCredential
$credentials | Format-Table -Property Target, UserName, Password
var results = powerShell.Invoke();
foreach (var result in results)
Console.WriteLine(result);