I read somewhere that the param section must be the very first thing that appears in a script or function so this is what I have come up with in order to set the default values of each of the params. Yes, it is unorthodox, but it works.
Param (
[Xml]$xmlObj = (Get-Content "Download-VBK_config.xml"),
[String]$dlFrom = $xmlObj.Configuration.Download.From,
[String]$dlTo = $xmlObj.Configuration.Download.To,
[String]$exTo = $xmlObj.Configuration.Extract.To
)
However, is there a better way I could go about setting a param's default value by loading values from an XML file?