Could you show us the exact xml code for your task?
Also there is a more efficient way of running powershell tasks on an agent, have a look at Task.Agent.PowerShell.WithParams.mpx fragment in KEvin Holman's fragment library.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Thogether
I try to create a task, that starts a powershellscript, which is located on a central scriptserver. The task is for the Objects Windows Server. I wanna start the powershellscript with the DNSName of the target-server as parameter.
So I created a task with the following settings:
Application: powershell.exe
Parameters: -file "\server\f$\test\pscript.ps1" $Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/DNSName$
But now the script works with the parameter "$Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/DNSName$" instead of the DNSName.
I also tried to set the working directory to my local client and start the script on the server, but had the same issue.
It works, when I copy the Script to my local client, and use the following settings:
Application: powershell.exe
Parameters: -file "C:\test\pscript.ps1" $Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/DNSName$
Anybody know how I can start the script on the Server, with the DNSName as parameter?
Could you show us the exact xml code for your task?
Also there is a more efficient way of running powershell tasks on an agent, have a look at Task.Agent.PowerShell.WithParams.mpx fragment in KEvin Holman's fragment library.