Public/ConvertTo-UnattendXmlPassword.ps1

1
2
3
4
5
6
7
8
9
10
11
12
function ConvertTo-UnattendXmlPassword {
    [CmdletBinding()]
    [OutputType([string])]
    param(
        [Parameter(Mandatory,ValueFromPipeline)]
        [ValidateNotNullOrEmpty()]
        [securestring]
        $Password
    )

    ConvertTo-Base64 -Data (Get-PlaintextFromSecureString -SecureString $Password)
}