A plug-in is a custom business logic that integrates with Microsoft Dynamics CRM to modify or extend the standard behavior of the platform. Plugins are mostly written in C# language and can be registered at various events like Create, Read, Update and Delete and can run either in Synchronous or Asynchronous mode.
In this article, will explain how to download the Plugin Registration Tool using Power Shell Script from Nuget.
Follow the below steps to download the same.
Step 1
Create a folder in D Drive and name it as “Dynamics_365_Development_Tools“
Step 2
Click on Windows, search for Windows PowerShell and open it.
Step 3
Type the below command to change the directory.
cd D:\Dynamics_365_Development_Tools
Step 4
Copy & Paste the below PowerShell script in PowerShell Window to download Plugin Registration Tool from Nuget.
$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
##
##Remove NuGet.exe
##
Remove-Item nuget.exe
Plugin Registration Tool download is in progress.
Plugin Registration Tool is downloaded successfully.
Step 5
Go to D:\Dynamics_365_Development_Tools\Tools folder for Plugin Registration Tool.
To get the latest version of this Plugin Registration Tool, repeat the steps mentioned above
Hope you have successfully downloaded Plugin Registration Tool from NuGet using Powershell script.
Please like and share your valuable feedback on this article.