I am trying to create a powershell script to append some files.
I want to run this from a TI process but when I try to run the TI process powershell opens briefly, literally in the blink of an eye and then closes.
More to the point the powershell command does not run. When the powershell window opens I can see there is some red writing as if there is a problem but it closes too quickly before I can read it.
If I run the powershell command in powershell then it runs ok.
I am running the TM1 server as an application.
here is the code:
Code: Select all
ExecuteCommand('Powershell get-childItem "C:\Source\SearchFiles\*.csv" | foreach {[System.IO.File]::AppendAllText("C:\Source\SearchFiles\TestNewFile.csv", [System.IO.File]::ReadAllText($_.FullName))}', 0);