Public/Set-FileEMailConfig.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<#
    .SYNOPSIS
    Reads the email configuration from an XML file and persists in a script level variable

    .DESCRIPTION
    Reads the email configuration from an XML file in the CliXml format.

    .INPUTS
    None. You cannot pipe objects to Set-FileEmailConfig.

    .PARAMETER Path
    The path to the CliXMl file. Defaults to "email-config.xml"

    .OUTPUTS
    None.
#>

function Set-FileEmailConfig {
    param([String]$Path = "email-config.xml")
    Set-Variable -Name __emailconfig -Scope Script -Value (Import-CliXml -Path $Path)
}