xml/psPAS.CyberArk.Vault.Credential.Type.ps1xml
<?xml version="1.0" encoding="utf-8" ?> <Types> <Type> <Name>psPAS.CyberArk.Vault.Credential</Name> <Members> <ScriptMethod> <Name>ToSecureString</Name> <Script> $this | Select-Object -ExpandProperty Password | ConvertTo-SecureString -AsPlainText -Force </Script> </ScriptMethod> <ScriptMethod> <Name>ToPsCredential</Name> <Script> param([string]$UserName) if (!$UserName) { $UserName = $this | Select-Object -ExpandProperty UserName } New-Object System.Management.Automation.PSCredential ($UserName,( $this | Select-Object -ExpandProperty Password | ConvertTo-SecureString -AsPlainText -Force)) </Script> </ScriptMethod> </Members> </Type> </Types> |