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
System.Management.Automation.ParameterBindingException:
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!