How to use a recurring Integration Endpoint for importing data
You are here
Powershell to Deploy a PPAC UNO Environment
PowerShell Script to Deploy an UNO Environment
Below is a PowerShell script to deploy a unified developer environment for F&O. But first, be sure to read Aurélien CLERE's great blog post about this type of environment. You should also check out this tech talk on the UDE environment type and some additional reading from MSFT. I found myself having to deploy a few of the UDE environments so I upgraded the PS Script form Aurélien's blog so it will prompt for a display name. That's all.
# Function to remove spaces from a string
function Remove-Spaces {
param (
[string]$InputString
)
return $InputString -replace ' ', ''
}# Function to remove non-alphanumeric characters from a string
function Remove-NonAlphanumeric {
param (
[string]$InputString
)
return $InputString -replace '[^a-zA-Z0-9]', ''
}# Prompt for the environment display name
$instanceName = Read-Host -Prompt 'Input your environment display name'# Clean up the instance name
$instanceName = Remove-Spaces -InputString $instanceName
$instanceName = Remove-NonAlphanumeric -InputString $instanceName# Install the necessary module
Write-Host "Installing Microsoft PowerApps Administration PowerShell module..."
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force# Create a session against the Power Platform API
Write-Host "Creating a session against the Power Platform API..."
Add-PowerAppsAccount -Endpoint prod# Construct the JSON object to pass in
$jsonObject = @"
{
"PostProvisioningPackages":
[
{
"applicationUniqueName": "msdyn_FinanceAndOperationsProvisioningAppAnchor",
"parameters": "DevToolsEnabled=true|DemoDataEnabled=true"
}
]
}
"@ | ConvertFrom-Json# Kick off new environment provisioning
Write-Host "Provisioning new environment..."
New-AdminPowerAppEnvironment -DisplayName $instanceName -EnvironmentSku Sandbox -Templates "D365_FinOps_Finance" -TemplateMetadata $jsonObject -LocationName "unitedstates" -ProvisionDatabaseWrite-Host "Environment provisioning initiated successfully!"