Goal:
I am building a Password Vault. I want to be able to restructure the table and change the names of the columns.
Question:
Is it possible to complete this task? And if yes how would I go about doing it?
Example:
UserName Resource Password Properties
-------- -------- -------- ----------
username My App password {[hidden, False], [applicationid, 0...
Is it possible to change the name of the column UserName,Resource and Password permanently for future entries?
function Get-SystemCreds{
param(
[switch]$AddCred,
[switch]$Getcred,
[switch]$RemoveCred
)
$vaultAssembly = [void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
if($AddCred -eq $true){
$vaultAssembly
$ID= Read-Host 'Enter ID'
$Password= Read-Host 'Password'
$URL = Read-Host 'Enter URL'
$vault=New-Object Windows.Security.Credentials.PasswordVault
$cred=New-Object Windows.Security.Credentials.PasswordCredential($ID, $Password, $URL)
$vault.Add($cred)
}
if ($RemoveCred -eq $true){
$vaultAssembly
$ID = Read-Host 'Enter ID'
$cred = Get-SystemCreds -Getcred |
Where-Object {$_.UserName -eq $ID}
$vault.Remove($cred)
}
if ($Getcred -eq $true){
$vaultAssembly
(new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() | % { $_.RetrievePassword(); $_ }
}
}