For the complete documentation index, see llms.txt. This page is also available as Markdown.

PowerShell connectivity methods to Devolutions Server

The following methods describe how to connect to Devolutions Server using PowerShell.

Method 1: Using Remote Desktop Manager Cmdlets

This new workspace created with PowerShell will only exist in the user context it was created.

  1. Follow the instructions in Devolutions.PowerShell module to properly install the module.

  2. Create a new Devolutions Server workspace using an Application Key and Application Secret with the following script. This script should only be used once to avoid creating many new workspaces. Replace the values of the four variables (lines 7 to 10) with your own information, then run the script.

$dsname = "DVLS PowerShell"
$ds = Get-RDMDataSource -Name $dsname

# If the workspace doesn't exist, create it.
if ([string]::IsNullOrEmpty($ds))
{
  $dsname = "DVLS PowerShell"
  $dsurl = "https://your_dvls_url"
  $appkey = "your_appkey"
  $appsecret = "your_appsecret"

  $ds = New-RDMDataSource -DVLS -Name $dsname -Server $dsurl -ScriptingTenantID $appkey -ScriptingApplicationPassword $appsecret -SetDatasource -WarningAction SilentlyContinue
  Set-RDMDataSource $ds
}

Set-RDMCurrentDataSource $ds
  1. To connect to the workspace, use these lines in all your scripts.

Method 2: Using Devolutions Server Cmdlets

  1. Follow the instructions in Devolutions.PowerShell module to properly install the module.

  2. The script expects an Application Key and Application Secret and URL to be defined in environment variables. Since storing credentials in scripts is frowned upon, adapt a local file for running your own tests.

  1. The following sample script can be used to connect using an Application Key and Application Secret.

  1. Once the script is completed and all tasks are fulfilled, close the session using the Close-DSSession cmdlet.

See also

Last updated

Was this helpful?