web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

(0) ShareShare
ReportReport
Posted on by 115

Hi everyone,

I am trying to install CRM Portals (open source) and having issues with registering cmdlets using powershell based on the instructions onto my machine. I need to do this before installing Portal solutions to my online CRM environment.

When I run the powershell script RegisterXrmTooling.ps1 I get an error below in red and then the rollback happens:

An exception occurred while trying to find the installers in the C:\powershell\Microsoft.Xrm.Tooling.PackageDeployment.P
owershell.dll assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExc
eptions property for more information.
Aborting installation for C:\powershell\Microsoft.Xrm.Tooling.PackageDeployment.Powershell.dll.

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to get installer types in the C:\powershell\Microsoft.Xrm.Tooling.PackageDeploy
ment.Powershell.dll assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to
load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

I can't figure out this problem as the dll's all exist in the file directory and it's the latest 365 sdk.

Can anyone help in installing the Xrm Tooling Connector?

Many Thanks.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

    I'm having the same thing happen - did you find out what was blocking you in Powershell? I'm going to try the next steps to get the portal installed - but it's not too reassuring to have the first simple hurdle fall down on me :)

  • Community Member Profile Picture
    on at
    RE: Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

    As expected - without getting the pre-req step of registering the PackageDeployer in the 365SDK....the attempt to deploy had two major fail points:

    Package Import
    Select a package to import:
    [0] 0) Starter Portal [1] 1) Community Portal [2] 2) Customer Portal [3] 3) ESS Portal [4] 4) Partner Portal
    [5] 5) Partner Field Service[6] 6) Partner Project Service [?] Help (default is "0"): 0
    Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.Xrm.Tooling.Connector' is not installed on this machine.
    At C:\_dev\365SDK\Portals\PackageDeployerPackages\ImportPackage.ps1:21 char:13
    + Add-PSSnapin <<<< Microsoft.Xrm.Tooling.Connector
    + CategoryInfo : InvalidArgument: (Microsoft.Xrm.Tooling.Connector:String) [Add-PSSnapin], PSArgumentExce
    ption
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

    Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.Xrm.Tooling.PackageDeployment' is not installed on this machin
    e.
    At C:\_dev\365SDK\Portals\PackageDeployerPackages\ImportPackage.ps1:22 char:13
    + Add-PSSnapin <<<< Microsoft.Xrm.Tooling.PackageDeployment
    + CategoryInfo : InvalidArgument: (Microsoft.Xrm.Tooling.PackageDeployment:String) [Add-PSSnapin], PSArgu
    mentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand


    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:
    Credential
    The term 'Get-CrmConnection' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
    ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\_dev\365SDK\Portals\PackageDeployerPackages\ImportPackage.ps1:27 char:33
    + $CRMConn = Get-CrmConnection <<<< -ServerUrl $serverUrl -OrganizationName $organizationName -Credential $cred -L
    ogWriteDirectory C:\DebugTrace -Verbose -MaxCrmConnectionTimeOutMinutes 120
    + CategoryInfo : ObjectNotFound: (Get-CrmConnection:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    The term 'Import-CrmPackage' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
    ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\_dev\365SDK\Portals\PackageDeployerPackages\ImportPackage.ps1:34 char:18
    + Import-CrmPackage <<<< -CrmConnection $CRMConn -PackageDirectory $packageDirectory -PackageName $packageName -Verbos
    e -Timeout $timeout -RuntimePackageSettings "LCID=$lcid|DataImportBypass=$bypassData" -LogWriteDirectory C:\DebugTrace
    + CategoryInfo : ObjectNotFound: (Import-CrmPackage:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Press Enter to exit:

  • Community Member Profile Picture
    on at
    RE: Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

    A little more digging and I found that in this documentation page:

    [View:https://msdn.microsoft.com/en-us/library/dn689040.aspx:750:50]

    Prerequisites

    To use the XRM tooling cmdlets, you need PowerShell version 3.0 or later. To check the version, open a PowerShell window and run the following command: $Host

    Set the execution policy to run the signed PowerShell scripts. To do so, open a PowerShell window as an administrator and run the following command: Set-ExecutionPolicy -ExecutionPolicy AllSigned

    Checking the version of Powershell - I found it to have v2.0 and not the required v3.0:

    PS C:\_dev\365SDK\Portals\PackageDeployerPackages> $Host

    Name             : ConsoleHost

    Version          : 2.0

    InstanceId       : bb999b68-2c20-22ff-b850-d1234511f4b7

    UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface

    CurrentCulture   : en-GB

    CurrentUICulture : en-US

    PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy

    IsRunspacePushed : False

    Runspace         : System.Management.Automation.Runspaces.LocalRunspace

    PS C:\_dev\365SDK\Portals\PackageDeployerPackages>

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

    As soon as i updated Powershell to v3.0 instead of 2.0 - the "RegisterXRMTooling.ps1" script executed fine and succesfully installed!

    On to the next hurdle....

    --------------------------------------------

    PS C:\Windows\system32> get-executionpolicy

    Unrestricted

    PS C:\Windows\system32> cd C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell

    PS C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell> .\RegisterXRMTooling.ps1

    Found Microsoft.Xrm.Tooling.CrmConnector.Powershell.dll

    Microsoft (R) .NET Framework Installation utility Version 4.7.2558.0

    Copyright (C) Microsoft Corporation.  All rights reserved.

    Running a transacted installation.

    Beginning the Install phase of the installation.

    See the contents of the log file for the C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmCo

    nnector.Powershell.dll assembly's progress.

    The file is located at C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell

    .InstallLog.

    Installing assembly 'C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.d

    ll'.

    Affected parameters are:

      logtoconsole =

      assemblypath = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.dll

      logfile = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.InstallLo

    g

    The Install phase completed successfully, and the Commit phase is beginning.

    See the contents of the log file for the C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmCo

    nnector.Powershell.dll assembly's progress.

    The file is located at C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell

    .InstallLog.

    Committing assembly 'C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.d

    ll'.

    Affected parameters are:

      logtoconsole =

      assemblypath = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.dll

      logfile = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.CrmConnector.Powershell.InstallLo

    g

    The Commit phase completed successfully.

    The transacted install has completed.

    Found Microsoft.Xrm.Tooling.PackageDeployment.Powershell.dll

    Microsoft (R) .NET Framework Installation utility Version 4.7.2558.0

    Copyright (C) Microsoft Corporation.  All rights reserved.

    Running a transacted installation.

    Beginning the Install phase of the installation.

    See the contents of the log file for the C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.Packa

    geDeployment.Powershell.dll assembly's progress.

    The file is located at C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Power

    shell.InstallLog.

    Installing assembly 'C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powersh

    ell.dll'.

    Affected parameters are:

      logtoconsole =

      assemblypath = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powershell

    .dll

      logfile = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powershell.Inst

    allLog

    The Install phase completed successfully, and the Commit phase is beginning.

    See the contents of the log file for the C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.Packa

    geDeployment.Powershell.dll assembly's progress.

    The file is located at C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Power

    shell.InstallLog.

    Committing assembly 'C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powersh

    ell.dll'.

    Affected parameters are:

      logtoconsole =

      assemblypath = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powershell

    .dll

      logfile = C:\_dev\365SDK\SDK\Tools\PackageDeployer\PowerShell\Microsoft.Xrm.Tooling.PackageDeployment.Powershell.Inst

    allLog

    The Commit phase completed successfully.

  • Community Member Profile Picture
    on at
    RE: Powershell Register Dynamics 365 SDK cmdlets (RegisterXrmTooling.ps1)

    Portal installed first time after this pre-req configuration was successful

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans