Skip to content

rnwood/Rnwood.Dataverse.Data.PowerShell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rnwood.Dataverse.Data.PowerShell

Rnwood.Dataverse.Data.PowerShell

A PowerShell module for connecting to Microsoft Dataverse (used by Dynamics 365 and Power Apps) to query and manipulate data, solutions and customisations.

This module works in PowerShell Desktop and PowerShell Core, supporting Windows, Linux, and macOS.

Features

  • Creating, updating, upserting and deleting records, including M:M records
  • Simple PowerShell objects for input and output instead of complex SDK Entity classes
    • Automatic data type conversion using metadata - use friendly labels for choices and names for lookups
    • Automatic lookup conversion - use record names instead of GUIDs (when unique)
  • On behalf of (delegation) support for create/update operations
  • Duplicate detection support for create/update/upsert operations
  • Full support for automatic paging
  • Concise PowerShell-friendly hashtable-based filters with grouped logical expressions (and/or/not/xor) and arbitrary nesting
  • Batching and parallelisation support for efficient bulk operations
  • Auto-retries support in many cmdlets
  • Comprehensive metadata operations
    • Create, read, update, and delete entities, attributes, option sets, and relationships
    • manipulate model-driven apps, forms, views
    • manipulate solutions and solution components

Note: On-premise Dataverse environments are not supported.

Quick Start

Installation

# Set execution policy (one-time setup)
Set-ExecutionPolicy –ExecutionPolicy RemoteSigned –Scope CurrentUser

# Install module
Install-Module Rnwood.Dataverse.Data.PowerShell -Scope CurrentUser

For detailed installation instructions, including versioning, see Installation Guide.

Basic Usage

# Connect to Dataverse and set as default
# omit the -Url for a menu
Get-DataverseConnection -url https://myorg.crm11.dynamics.com -interactive -setasdefault

# Query records
Get-DataverseRecord -TableName contact -FilterValues @{ lastname = 'Smith' }

# Create a record
Set-DataverseRecord -TableName contact -InputObject @{ 
    firstname = 'John'
    lastname = 'Doe'
    emailaddress1 = '[email protected]'
} -CreateOnly

# Update a record
Set-DataverseRecord -TableName contact -Id $contactId -InputObject @{ 
    description = 'Updated via PowerShell'
}

# Delete a record
Remove-DataverseRecord -TableName contact -Id $contactId

For more advanced scenarios including metadata and customisations, see the documentation section below.

Documentation

Getting Started

Core Concepts

Advanced Topics

Common Use Cases

  • Use Cases - Real-world scenarios including CI/CD pipelines, data import/export, mass updates, and source control management

Reference

Main Cmdlets

Data Operations

Advanced Operations

Advanced Operations

Record Access Management

View Management

App Module Management

App Module Component Management

Web Resource Management

Sitemap Management

Environment Variables

Connection References

Metadata Operations

Metadata Cache Management

  • Clear-DataverseMetadataCache — clear the metadata cache

Form Management

Form Component Management

Tabs:

  • [Get-DataverseFormTab] — retrieve tabs from forms
  • [Set-DataverseFormTab] — create or update form tabs
  • [Remove-DataverseFormTab] — delete tabs from forms

Sections:

  • [Get-DataverseFormSection] — retrieve sections from form tabs
  • [Set-DataverseFormSection] — create or update form sections
  • [Remove-DataverseFormSection] — delete sections from forms

Controls:

  • [Get-DataverseFormControl] — retrieve controls from form sections
  • [Set-DataverseFormControl] — create or update form controls (supports all standard control types and raw XML)
  • [Remove-DataverseFormControl] — delete controls from forms

Additional Operations

For operations not covered by the cmdlets above, use Invoke-DataverseRequest with SDK request objects to execute any Dataverse SDK operation directly. The cmdlet supports two main approaches:

  • Request parameter set: Pass SDK request objects directly (returns raw SDK response objects)
  • NameAndInputs parameter set: Specify request name and parameters as hashtable (returns converted PSObject by default, use -Raw for raw response)

See the Invoke-DataverseRequest documentation for details on response conversion and parameter sets.

Support and Contributing

Contributing

See CONTRIBUTING.md for detailed guidelines.

License

See LICENSE file for details.

About

A PowerShell module for interacting with Microsoft Dataverse.

Topics

Resources

License

Contributing

Stars

Watchers

Forks