Misc/Get-SecretValueText.ps1
function Get-SecretValueText { param( [Parameter(Mandatory = $true)] [PSCustomObject]$object ) if (($object | Get-Member).Name.Contains('SecretValueText')) { return $object.SecretValueText } else { return (New-Object PSCredential "user",$object.SecretValue).GetNetworkCredential().Password } } |