Currently PSDataverse allows connecting to a single environment at a time. In order to work with multiple environments at a time we need to take data offline or open multiple PowerShell sessions. This can work well specially in production workloads, but for ad-hoc operations or special workloads a multi-connection feature can make life easier.
If we could name the connection when persisting it in the session like the following:
Connect-Dataverse https://test1.crm4.dynamics.com -Name Test1
Connect-Dataverse https://test2.crm4.dynamics.com -Name Test2
Then the following script becomes possible.
Send-DataverseOperation "accounts?`$select=name" -Connection Test1 -Out PsObjects |
ForEach-Object {
@{
Uri = new_names
Method = POST
Value = @{ new_name = $_.name }
}
} |
Send-DataverseOperation -Connection Test2
Currently PSDataverse allows connecting to a single environment at a time. In order to work with multiple environments at a time we need to take data offline or open multiple PowerShell sessions. This can work well specially in production workloads, but for ad-hoc operations or special workloads a multi-connection feature can make life easier.
If we could name the connection when persisting it in the session like the following:
Then the following script becomes possible.