New remote desktop application using powershell in C#

by tha4 at 2012-09-19 21:10:47

Using System.Management.Automation I tried adding a new remote desktop application in C#.
pipeline.Commands.AddScript(“new-item -path RDS:\RemoteApp\RemoteAppPrograms -name ‘calc2’ -ApplicationPath "%SYSTEMDRIVE%\Windows\system32\calc.exe"”);
Above is the code I used to create the application. However it throws a
A parameter cannot be found that matches parameter name ‘ApplicationPath’.

My guess is new-item cmdlet does not have a ApplicationPath parameter. So C# throws a error. Although this works fine in Powershell prompt.

Any solution is appreciated!
by poshoholic at 2012-09-19 21:47:21
I just moved this topic into the PowerShell for Developers forum so that it gets better visibility with that group.
by zatnas at 2013-01-08 22:46:45
I’ve discovered the problem.
It loads and works fine!
by Eurisko at 2013-01-29 06:53:17
Can you share what the problem was?