I wondered if there is a preferred way for automating creating a power platform environment ensuring
PowerShell (Install-Module -Name Microsoft.PowerApps.Administration.PowerShell) or CLI via Power Platform tools for VSCode
New-AdminPowerAppEnvironment -DisplayName 'Test' -Description 'Test UAT for all my Apps' -ProvisionDatabase -Location 'unitedkingdom' -EnvironmentSku Sandbox -DomainName Test
My attempt with the latter wasn't exactly successful!
Microsoft PowerPlatform CLI
Usage: pac [admin] [application] [auth] [canvas] [help] [org] [package] [paportal] [pcf] [plugin] [solution] [telemetry]
// connect to the default environment
pac auth create --url https://org123456.crm11.dynamics.com
pac admin create -n "Test" -r "United Kingdom" -t "Sandbox" -c "British Pound" -d "Test"
No right and wrong here...They both call the same engine, yet use a different interpreter. Some people like cli over PowerShell, so its more or less up to you.If you have multiple PowerShell scripts doing stuff, using this one also from PowerShell makes the most sense.
Join us for the next call on August 17, 2022 at 8am PDT.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.