Hello!
If I try to set the active datasource by entering
Set-RDMDatasource "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" or
$list = Get-RDMDataSource; Set-RDMDataSource $list[1].ID
I always receive this error:
Set-RDMDataSource : Cannot bind parameter 'DataSource'. Cannot convert the "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
value of type "System.Guid" to type "Devolutions.RemoteDesktopManager.Business.DataSources.BaseConnectionDataSource".
At line:1 char:46
+ $list = Get-RDMDataSource; Set-RDMDataSource $list[1].ID
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-RDMDataSource], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Devolutions.RemoteDesktopManager.Business.PS.Commands.Set
RDMDatasourceCommand
What am I doing wrong?
Best regards,
Andy
Hi Andy,
If you want to set the active datasource you need to use Set-RDMCurrentDataSourceSet-RDMCurrentDatasource {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}or$list = Get-RDMDataSource; Set-RDMCurrentDataSource $list[1].ID
If you are used to the deprecated cmdLets. Set-RDMCurrentDataSource is equivalent to Set-RDM-DataSource
In the new cmdLet, Set-RDMDatasource is used to set/save a data source that you changed properties with Set-RDMDataSourceProperty or created with New-RDMDataSource. It works the same way that when you create a new session with Powershell but with datasource.
We will update the help to make it clearer.
Best regards,
edited by Olivier Désalliers on 3/19/2015
Olivier Désalliers
Thanks for this information!