Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

[IDEA] Automate the installation of several languages for a Power Platform environment #14

Open
rpothin opened this issue Oct 10, 2020 · 2 comments
Labels
enhancement New feature or request pipeline This issue or pull request concerns a pipeline definition

Comments

@rpothin
Copy link
Member

rpothin commented Oct 10, 2020

Automate the provisioning of a Power Platform environment is one thing, but by default (with the Create Environment action in the Power Platform Build Tools extension for Azure DevOps) you can only specify one language.

It seems that the following solution (information provided by our friend David Rivard) could help us go further on this part:
https://github.com/seanmcne/Microsoft.Xrm.Data.PowerShell

Function to try: 'Enable-CrmLanguagePack'

----EXAMPLE POWERSHELL SCRIPT---------
Param(
[string]$connectionstring
)

Write-Output "Installing Microsoft.Xrm.Data.PowerShell"
Install-Module -Name Microsoft.Xrm.Data.PowerShell -Scope CurrentUser -Force

#Write-Output "Installing Microsoft.CrmSdk.XrmTooling.CrmConnector.PowerShell"
#Install-Package -Name Microsoft.CrmSdk.XrmTooling.CrmConnector.PowerShell -Scope CurrentUser -Force

Write-Output "Connecting to CRM"
$conn = Get-CrmConnection -Verbose -ConnectionString "$($connectionstring)"

Write-Output "Fetching organizationid"
$organizationid = (Get-CrmRecords -EntityLogicalName organization -conn $conn -Fields organizationid).CrmRecords[0].organizationid

Write-Output "Changing setting on organization: $($organizationid)"

Set-CrmRecord -EntityLogicalName organization -conn $conn -Id $organizationid -Fields @{"isautosaveenabled"= $false; "isexternalsearchindexenabled"= $true; "useskypeprotocol"=$false}

$org = Get-CrmRecord -EntityLogicalName organization -conn $conn -Id $organizationid -Fields isautosaveenabled,isexternalsearchindexenabled,useskypeprotocol
@rpothin
Copy link
Member Author

rpothin commented Oct 24, 2020

@BenediktBergmann if you follow the steps presented in your article, do you think you could store the PowerShell script in a "Scripts" folder at the root of the repository?

@BenediktBergmann
Copy link
Member

Yeah that should definitely be possible

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request pipeline This issue or pull request concerns a pipeline definition
Projects
None yet
Development

No branches or pull requests

2 participants