title: Cannot bind argument to parameter
body: <p>How do I get this powershell program to successfully execute?</p>
  
  <pre><code>$Source = "\\ahs-bind01\ftptest01\CRAR"
  Get-ChildItem -Path $Source -recurse
  
   #Declare the file path and sheet name
  
  $file = "C:\Users\us6205\Desktop\DatabaseNameConfigs\Test\CareMoveFileParentDestPaths.xlsx"
  
  $sheetName = "sheet1" 
  
  
   #Create an instance of Excel.Application and Open Excel file
  
  $objExcel = New-Object -ComObject Excel.Application
  
  $workbook = $objExcel.Workbooks.Open($file) 
  
  $sheet = $workbook.Worksheets.Item($sheetName)
  
  $objExcel.Visible=$false 
  
  
   #Count max row
  
  $rowMax = ($sheet.UsedRange.Rows).count 
  
   #Declare the starting positions
  
  $rowLOC,$colLOC = 1,1
  $rowUNC,$colUNC = 1,2 
  
  
   #loop to get values and store it 
  
  for ($i=1; $i -le $rowMax-1; $i++)
  
  { 
  
  $LOC = $sheet.Cells.Item($rowLOC+$i,$colLOC).text
  $UNC = $sheet.Cells.Item($rowUNC+$i,$colUNC).text 
  
  $Path = Get-ChildItem -Path $UNC -recurse |
   Where-Object { ($_.PSIsContainer -eq $true) -and  ( $_.FullName -match "$Source") } 
   $Dest = $Path | New-Item -path $Dest -itemtype directory | Move-Item -Path $Source -Destination $Dest -Force
   }
  
   #close excel file
  
  $objExcel.quit() 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/cw2Yn.png" alt="screenshot"></p>