Thursday, 5 July 2018

Microsoft Dynamics 365 SDK download using Powershell

Hello Everyone,

Normally we download the Microsoft dynamics CRM SDK from Microsoft  website until Microsoft Dynamics 365 version 9.0.

From Version 9.0 we have two options to download the SDK

1) Using the visual studio Nuget package manager

Manage NuGet Packages command for project References

2)  using the Powershell:

I am gonna show how  to download it on to the local folder.

First create a folder in your local computer
Drive : D
Folder: Tool

So the path would be D:/Tools

Search for the "Powershell" on your computer start menu..
Change the directory to desired directory using cd..
  cd D:\Tools

Copy the powershell script from Microsoft website

$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$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

##
##Remove NuGet.exe
##
Remove-Item nuget.exe





Then you can see on the screen shot SDK will be downloaded to the local folder:


As you can see the plugin registration tool, package deployment, CoreTools, ConfigurationMigration folder from  the image.

Then you start using the SDK for the development work.

I hope this helps..

SMB's and Enterprise Customers need of Support/Development/Consultancy/Licenses 
Contact us 




No comments:

Post a Comment

Note: only a member of this blog may post a comment.