Skip to content

Named Connections #57

@rezanid

Description

@rezanid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions