Scripts/Build-XML.ps1

function Build-XML
{
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [SecureString]$password_secure,
        [Parameter(Mandatory=$true)]
        [string]$account
    )
$cred = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password_secure))
$XMLbase = @"
<SkypeSettings>
    <UserAccount>
        <SkypeSignInAddress>TUSER@conocophillips.com</SkypeSignInAddress>
        <ExchangeAddress>TUSER@conocophillips.com</ExchangeAddress>
        <DomainUsername>conoco\TUSER</DomainUsername>
        <Password>TPASSWORD</Password>
        <ModernAuthEnabled>true</ModernAuthEnabled>
    </UserAccount>
</SkypeSettings>
"@


$find1 = "TUSER"
$find2 = "TPASSWORD"
$XMLbase2 = $XMLbase -replace $find1, $account
$XMLbase3 = $XMLbase2 -replace $find2, $cred
return $XMLbase3
}