@MichaelHan-MSFT
Thanks for the help on this, i've managed to get stage further and got the file imports working for csv when testing, but when run as an automated process the import-csv is failing
I have variable setup called TargetFile which is unc path to file
I can then do a Test-Path $TargetFile and this returns that the file is available, but when I use the import-csv I get an error 'ReportWrongProviderType is not valid, remove operation ReportWrongProviderType' but that is not in the command
I use the following command to import the data
$filedata=import-csv $TargetFile |Select "Header1","Header2","Header3|"
then cycle through each row with
foreach ($rowdata in $filedata)
{$resulta=$rowdata.[0].Header1
}
This all works fine if run through powershell ise, but i'm running this as an automated sql agent job