Powershell Step in SQL Job not returning full data

  • I created a sql job and have multiple powershell steps. Powershell step runs query on databases hosted on different servers. This has always worked for me and able to query databases and export data to csv files. This is first time I am running into an issue where it will only export 1 row and skip all other rows even.

    Powershell code works fine when I run it from Powershell ISE. It only acts weird when I run it as powershell step in the sql job.

  • This was removed by the editor as SPAM

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Hard to tell without code and output given.

  • This was removed by the editor as SPAM

  • sunchips wrote:

    I created a sql job and have multiple powershell steps. Powershell step runs query on databases hosted on different servers. This has always worked for me and able to query databases and export data to csv files. This is first time I am running into an issue where it will only export 1 row and skip all other rows even.

    https://xender.vip/

    Powershell code works fine when I run it from Powershell ISE. It only acts weird when I run it as powershell step in the sql job.

    I got this,...

  • One thing to be careful of is the version of PoSh in the SQL job might be different than what you see in the ISE. Different profile, version modules, etc.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply