title: PowerShell - Sorry, we couldn't find Microsoft.PowerShell.Core\FileSystem::
body: <p>I'm trying to modify the script created by <a href="https://learn-powershell.net/2010/09/04/converting-csv-file-or-files-into-an-excel-workbook/" rel="nofollow noreferrer">Boe Prox</a> that combines multiple CSV files to one Excel workbook to run on a network share.</p>
  
  <p>When I run it locally, the script executes great and combines multiple .csv files into one Excel workbook.</p>
  
  <pre><code>Clear-Host
  $OutputFile = "ePortalMonthlyReport.xlsx"
  $ChildDir = "C:\MonthlyReport\*.csv"
  cd "C:\MonthlyReport\"
  
  echo "Combining .csv files into Excel workbook"
  . C:\PowerShell\ConvertCSVtoExcel.ps1
  Get-ChildItem $ChildDir | ConvertCSVtoExcel -output $OutputFile
  echo " "
  </code></pre>
  
  <p>But when I modify it to run from a network share with the following changes:</p>
  
  <pre><code>Clear-Host
  # Variables
  $OutputFile = "ePortalMonthlyReport.xlsx"
  $NetworkDir = "\\sqltest2\dev_ePortal\Monthly_Report"
  $ChildDir = "\\sqltest2\dev_ePortal\Monthly_Report\*.csv"
  
  cd "\\sqltest2\dev_ePortal\Monthly_Report"
  
  echo "Combining .csv files into Excel workbook"
  . $NetworkDir\ConvertCSVtoExcel.ps1
  Get-ChildItem $ChildDir | ConvertCSVtoExcel -output $OutputFile
  echo " "
  </code></pre>
  
  <p>I am getting an error where it looks like it using the network path twice and I am not sure why:</p>
  
  <blockquote>
    <p>Combining .csv files into Excel workbook</p>
    
    <p>Converting \sqltest2\dev_ePortal\Monthly_Report\001_StatsByCounty.csv
    naming worksheet 001_StatsByCounty
    --done</p>
    
    <p>opening csv Microsoft.PowerShell.Core\FileSystem::\sqltest2\dev_ePortal\Monthly_Report\\sqltest2\dev_ePortal\Monthly_Report\001_StatsByCounty.csv) in excel in temp workbook</p>
    
    <p>Sorry, we couldn't find Microsoft.PowerShell.Core\FileSystem::\sqltest2\dev_ePortal\Monthly_Report\\sqltest2\dev_ePortal\Monthly_Report\001_StatsByCounty.csv. Is it possible it was moved, renamed or deleted?</p>
  </blockquote>
  
  <p>Anyone have any thoughts on resolving this issue?</p>
  
  <p>Thanks,</p>