we run the TeamCity Build Service on a Win 2008 Server Machine. My task is to open a Word Document and write several words and sentences. Afterwards the document should be closed automatically.
The TeamCity Process executes a MS Build.xml File. In this file i open a powershell. This Powershell is assigend to open a Word -Com Object and write some words as i mentioned before.
When I execute the Powershell on a local computer oder manually on the server it works highly well. But when the powershell-script is executed via the TeamcityService and the MSBuild.xml File the following error is shown:
[Exec] You cannot call a method on a null-valued expression.
[Exec] At C:\Firmwarebuilds\G8-IAX\branches\S-PUE\BS\CurrentPath.ps1:23 char:25
[Exec] + $Selection.Find.Execute <<<< (
[Exec] + CategoryInfo : InvalidOperation: (Execute:String) , RuntimeException
[Exec] + FullyQualifiedErrorId : InvokeMethodOnNull
Is it possible that the TeamCity Service has not enough permissions to execute a Powershell or to open a –Com Object ?
Are there anywhere on the Server settings to allow the Powershell to interact (open/write/close/…) a Word File?
As I already mentioned before when I execute the Powershell Script manually it works well.