How to run PowerShell from Azure Data Factory

2019-08-10 11:31发布

问题:

I have PowerShell script which splits a complex CSV file to a smaller CSV file for every 1000 records. Here is the code:

$i=0;Get-Content C:\Users\dell\Desktop\Powershell\Input\bigsizeFile.csv -ReadCount 1000 | %{$i++; $_ | Out-File C:\Users\dell\Desktop\Powershell\Output\file$i.csv
}

Now I want to use this script in Azure PowerShell and I want to run this from Azure Data Factory. Can Someone please help with this.

回答1:

you could execute your powershell command by using Custom activity in ADFv2. Here is an example.