Public/Set-FileConfig.ps1
<# .SYNOPSIS Reads the configuration from an XML file and persists in a script level variable .DESCRIPTION Reads the configuration from an XML file in the CliXml format. .INPUTS None. You cannot pipe objects to Set-FileConfig. .OUTPUTS None. .PARAMETER Path The path to the CliXMl file. Defaults to "config.xml" .OUTPUTS None. .NOTES Will attempt to IAM authenticate to check the configuration of both IAM and salesforce. #> function Set-FileConfig { [CmdletBinding()] [OutputType([System.Void])] param( [Parameter(Mandatory = $false, Position = 0, ValueFromPipeline)] [String] $Path = "config.xml" ) begin { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" } end { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" } process { Write-Debug "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" Set-Config (Import-CliXml -Path $Path) } } |