When testing my PowerShell script in Visual Code I got the following error:
the term '​​​​​' is not recognized as the name of a cmdlet, function,
However, finally I tested the same code in ISE and I did not get the same error!
try {
$file_name = Get-ChildItem -Path "F:\sample\uk-500-UTF.csv"
$csv_data = Import-Csv -Path $file_name.FullName -Delimiter ','
foreach ($line in $csv_data){
$line
break
}
}
catch{
Write-Host "Ran into an issue: $($PSItem.ToString())"
}