title: Powershell + Config files
body: <pre><code>[xml]$configSettings = get-content .\ScriptSigner.config
  Write-Host([string]::Format("XML Settings : {0}",$configSettings.InnerXml))
  
  $sourceFolder =  ($configSettings.folder.sourcefolder)
  $destinationFolder = ($configSettings.folder.destinationFolder)
  
  Write-Host ("Source Folder = $sourceFolder");
  Write-Host ("Destination Folder = $destinationFolder");
  
  $items = Get-ChildItem -Path @sourceFolder
  
  # enumerate the items array
  foreach ($item in $items)
  {
        # if the item is a directory, then process it.
        if ($item.Attributes -eq "Directory")
        {
              Write-Host $item.Name
        }
  }
  </code></pre>
  
  <p>The above is the powershell code that I am using to read all the child items from a directory. This directory is configured in the config file. </p>
  
  <p>But I keep getting this error </p>
  
  <pre><code>     ERROR: Get-ChildItem : A positional parameter cannot be found that accepts argument '\'.
  ERROR: At F:\Gagan\powershell\ScriptSigner.ps1:37 char:23
  ERROR: + $items = Get-ChildItem &lt;&lt;&lt;&lt;  -Path @sourceFolder
  ERROR:     + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
  ERROR:     + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
  ERROR:
  </code></pre>
  
  <p>Somebody care to help please ?</p>
  
  <p>Thanks and Regards
  gagan</p>