5 Replies Latest reply on Oct 12, 2021 10:41 AM by Nico Heinze

    Pre-Processing Command Not Running

    Diane Royer Guru

      I have a mapping set up that uses a File List as the source.  Then on the mapping task, in the PreProcessing field, I entered this command:  call C:\Scripts\Informatica\Get-Advancement-Donation-report.bat.  This bat file runs a powershell that builds the file list for the task.  However, every time I try to run the mapping task, it tells me that it cannot find the source file.  It doesn't mention not being able to run the preprocessing command, just not being able to find the source.  When I check where the bat file should have run and created the file list, it is not there.  If I run the bat file from anywhere on the machine, it runs perfectly.  What am I doing wrong?

        • 1. Re: Pre-Processing Command Not Running
          Rakshitha K. R. Guru

          What does that bat file has? Does not ahve any Interactive commands ?

          Send us the session log to see if we find any information there?

          Try to use the bat file in command task and see if that makes any difference?

           

          Regards,

          Rakshitha

          • 2. Re: Pre-Processing Command Not Running
            Diane Royer Guru

            The bat file does not have anything interactive in it.  The bat file just says:

            cd C:\Scripts\Informatica

            powershell -ExecutionPolicy ByPass .\Get-Advancement-Donation-Reports.ps1

             

            Informatica won't show me the session log.  When I try to download it, I just get an message that says it isn't available.  How would I "use the bat file in command task"?

            • 3. Re: Pre-Processing Command Not Running
              Ashwini Ramakrishna Guru

              Hello Diane,

               

              Instead of calling in pre/post of the mapping task, could please try calling in the command task followed by the path in it.You can refer the below example on how you can use it

               

              Support

               

               

              Please let us know if this helps your usecase

              • 4. Re: Pre-Processing Command Not Running
                Srini Veeravalli Guru

                The below worked for me at pre-processing cmd:

                mine was like
                echo off | Powershell.exe -executionpolicy remotesigned -File C:\Integration\<filename>.ps1 \\<networkhost>\c$\<fodlerPaths>\SrcFiles\ Arg[1] Arg[2]

                You need to make sure that the file reachable to IICS agent

                • 5. Re: Pre-Processing Command Not Running
                  Nico Heinze Guru

                  Does the PowerShell script use any mapped network drives?

                  The point is that Windows service applications (like PowerCenter or IICS and many other ones) cannot access mapped network drives; the security context of a Windows service user is set up way earlier than the point in time when network drives are mapped.

                   

                  For example, let's suppose you have a mapped network drive Z: pointing to a file share \\fpsrv01\sharexyz .

                  Let's also suppose that your PowerShell script searches for files on this network share Z: .

                  That does run when you execute the PowerShell script from a CMD window, no question.

                  But it cannot possibly work from within IICS because the Z: drive simply doesn't exist in the security context of the Windows service running the Secure Agent.

                  Hence my question.

                   

                  Regards,

                  Nico