Back to Basics # 8: Download Dynamics CRM Tools Using Power Shell

Introduction:

In Dynamics 365 CRM or Power Platform, certain tools like Configuration Migration Tool,Package Deployer,Plug-in Registration Tool ,Solution Packager tool and Code Generation Tool are required for every project development. By using the following process one can easily set up to work readily in few minutes.

Step 1:

Navigate to Windows Explorer and type Windows Power Shell as shown in the below figure.

Step 2 :

Click on open as shown below figure

Step 3:  

After Step 2, click on open, new popup will get opened as shown below

Step 4:

Create directory by using the following command , here in this example I gave directory[Folder] name as devtools and click on enter devtools folder gets created as shown below

Syntax : mkdir <FolderName>

Example : mkdir devtools

Step 5 :

After Step 4, new folder with name devtools gets created. Now go to that folder with the below command  as shown in below figure

Syntax : cd <FolderName>

Ex: cd devtools

Step 6:

Now copy below power shell script and paste it in the above window and click on enter key in keyboard or just paste it  as shown in the following figure below.

Code:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$sourceNugetExe = “https://dist.nuget.org/win-x86-commandline/latest/nuget.exe&#8221;

$targetNugetExe = “.\nuget.exe”

Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore

Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe

Set-Alias nuget $targetNugetExe -Scope Global -Verbose

##

##Download Plugin Registration Tool

##

./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -O .\Tools

md .\Tools\PluginRegistration

$prtFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match ‘Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.’}

move .\Tools\$prtFolder\tools\*.* .\Tools\PluginRegistration

Remove-Item .\Tools\$prtFolder -Force -Recurse

##

##Download CoreTools

##

./nuget install  Microsoft.CrmSdk.CoreTools -O .\Tools

md .\Tools\CoreTools

$coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match ‘Microsoft.CrmSdk.CoreTools.’}

move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools

Remove-Item .\Tools\$coreToolsFolder -Force -Recurse

##

##Download Configuration Migration

##

./nuget install  Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf -O .\Tools

md .\Tools\ConfigurationMigration

$configMigFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match ‘Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf.’}

move .\Tools\$configMigFolder\tools\*.* .\Tools\ConfigurationMigration

Remove-Item .\Tools\$configMigFolder -Force -Recurse

##

##Download Package Deployer

##

./nuget install  Microsoft.CrmSdk.XrmTooling.PackageDeployment.WPF -O .\Tools

md .\Tools\PackageDeployment

$pdFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match ‘Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf.’}

move .\Tools\$pdFolder\tools\*.* .\Tools\PackageDeployment

Remove-Item .\Tools\$pdFolder -Force -Recurse

##

##Download Package Deployer PowerShell module

##

./nuget install Microsoft.CrmSdk.XrmTooling.PackageDeployment.PowerShell -O .\Tools

$pdPoshFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match ‘Microsoft.CrmSdk.XrmTooling.PackageDeployment.PowerShell.’}

move .\Tools\$pdPoshFolder\tools\*.* .\Tools\PackageDeployment.PowerShell

Remove-Item .\Tools\$pdPoshFolder -Force -Recurse

##

##Remove NuGet.exe

##

Remove-Item nuget.exe

Step 7:

Now navigate to the folder devtools that was created in step 4 and you could see a folder with name Tools and open that Tools folder to see subfolders where we can find separate folders for Configuration Migration ,Core Tools,PackageDeployment,PackageDeployment.PowerShell and Plugin Registration  folders gets created as shown below.

Step 8:

Now to test whether the tools are working fine or not , open Configuration Migration folder and click on DataMigrationUtility.exe as shown below figure.

Step 9:

After Step 8, new popup window of DataMigration utility get’s opened, click on Create Schema and click on continue as shown below figure

Step 10:

After Step 9, click on continue . User will be navigated to next screen . Select office 365 option and select on Display list of available organizations and click on Login as shown below figure

Step 11:

After login in Step 10, provide credentials for crm login it could be trial instance/ dev environment user name and password and user will be navigated to the below screen and could see entities gets populated as shown below which confirms tool installed properly.

References :

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/download-tools-nuget?view=op-9-1

Conclusion:

In this way ,one can easily get CRM tools that are required for development with less time and ready to use tools readily.


Discover more from Common Man Tips for Power Platform, Dynamics CRM,Azure

Subscribe to get the latest posts to your email.