-
Notifications
You must be signed in to change notification settings - Fork 102
Troubleshoot
We appreciate you taking the time to read up on how to troubleshoot issues with the d365fo.tools. Ideally, this will enable you to get to a solution for your issue on your own. If not, it will still help you gather the information needed to get help from others.
IMPORTANT Note that some of the information gathered may contain sensitive information. Make sure to remove any sensitive information before sharing the information with others.
Check whether the latest version of d365fo.tools is being used. This can be done with the Get-Module d365fo.tools
cmdlet. If the cmdlet shows no output, add the -ListAvailable
switch to see all versions installed on the machine. Usually the latest version will be used unless a different version is specified when loading the module. Compare the version with the latest version on PowerShell Gallery.
Why is this important? If an older version is used, a first step in troubleshooting is to update to the latest version. If the issue is already fixed in the latest version, there is no need to troubleshoot further. On the other hand, if the module needs to be on a specific older version, this is important information to know.
Check which version of PowerShell is being used. This can be done with the $PSVersionTable
variable.
Why is this important? The module is primarily developed and tested on Windows Server environments with Windows PowerShell (i.e. PowerShell 5.1). If you are using PowerShell Core (i.e. PowerShell 6 or 7) or an older version of Windows PowerShell, there may be issues.
Some cmdlets of the module rely on other components, for example SQLPackage.exe for importing and creating bacpac and dacpac files. If you know the components used by the cmdlet, check the version of those components as well.
Why is this important? Sometimes the issue is not with the d365fo.tools, but the component it relies on. If the component is not up to date, it may contain a bug that is already fixed in a newer version.
Powershell provides some common parameters that can be used with any cmdlet, see about common parameters. Often used parameters for troubleshooting are -Verbose
and -Debug
. Support for common parameters varies per cmdlet, but these two are supported by most.
Why is this important? The
-Verbose
parameter will provide additional information about what the cmdlet is doing. The-Debug
parameter will provide even more information, including the values of variables used in the cmdlet. This can be very useful to see what is going on and where the issue is.
Even with -Verbose
and -Debug
, the output of a cmdlet may not contain all the available information about an error that ocurred. To get more information, use the automatic variable $Error
. This variable contains an array of all errors that have occurred in the current session. The most recent error is $Error[0]
, the second most recent is $Error[1]
, etc. To get more information about an error, use the | Format-List
cmdlet. For example, $Error[0] | Format-List
will show the error message, the stack trace, and more.
Why is this important? The error message may not contain all the information needed to troubleshoot an issue. The stack trace may contain more information about where the issue occurred.
Start-Transcript -Path "C:\Temp\PowerShellSession.log" -Append
Get-PSFMessage -Errors | Format-List
Get-PSFMessage -Errors | Format-List | Out-file c:\temp\errors.txt
Get-PSFMessage -Level InternalComment | Format-List
Get-PSFMessage -Level InternalComment | Format-List | out-file C:\temp\sqlcommands.txt
explorer.exe (Split-Path $(Get-Module d365fo.tools -ListAvailable | Select-Object -First 1).Path -Parent)
($HashArray.Keys | ForEach-Object {"-$($_) `"$($HashArray.Item($_))`""}) -Join " "
For general PowerShell debug information, see How to debug scripts in Windows PowerShell ISE.
To debug a cmdlet, first make sure the module is loaded with the individual files. Then open the .ps1 file of the cmdlet in PowerShell ISE and set a breakpoint. Finally, call the cmdlet.
- Install as a non-Administrator
- Install as a Administrator
- Import d365fo.tools module
- List available commands from d365fo.tools module
- Get help content for a command
- Start, Stop and List services
- Import users into the D365FO environment
- Import external users into the D365FO environment
- Enable users in the D365FO environment
- Update users in the D365FO environment
- Provision D365FO environment to new Azure AD tenant
- Import a bacpac file into a Tier1 environment
- List modules / models
- Compile module
- Install AzCopy
- Install SqlPackage
- Install Nuget
- Speed up LCS download via AzCopy
- Download latest bacpac from LCS via AzCopy
- Register NuGet source
- Configure Azure Logic App
- Fix AzureStorageConfig
- Run a runnable class
- Update users in environment
- Work with Azure Storage Account
- Work with packages, resource label files, language and lables
- Working with the different D365 services