internal/functions/clear-ax2012standardpowershellmodule.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

<#
    .SYNOPSIS
        Clear the imported AX 2012 PowerShell modules
         
    .DESCRIPTION
        Removes the different AX 2012 PowerShell modules that has been loaded into the session.
         
    .EXAMPLE
        PS C:\> Clear-Ax2012StandardPowershellModule
         
        This will remove all the known AX 2012 PowerShell modules that have been loaded.
        It is connected to the use of Import-Module $Script:AxPowerShellModule
         
    .NOTES
        Author: Mötz Jensen (@Splaxi)
         
#>

function Clear-Ax2012StandardPowershellModule {
    [CmdletBinding()]
    param ( )

    Remove-Module @("AxUtilLib", "AxUtilLib.PowerShell", "Microsoft.Dynamics.Administration", "Microsoft.Dynamics.AX.Framework.Management", "Microsoft.Dynamics.ManagementUtilities")
}