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

Notifications

Announcements

Community site session details

Community site session details

Session Id :

Find which Hot-Fixes (KBs) you have installed in Microsoft Dynamics AX

Dynamics AX Support Profile Picture Dynamics AX Support

With the new Microsoft Dynamics AX it is not so straight forward to determine the hot-fixes (KBs) you may have installed in your environments. So, I have created the following PowerShell script to list the fixes you have in your packages folder. Please provide me with feedback on improvement suggestions or if you find any issues with the script.

#
# This source code is freeware and is provided on an "as is" basis without warranties of any kind, 
# whether express or implied, including without limitation warranties that the code is free of defect, 
# fit for a particular purpose or non-infringing.  The entire risk as to the quality and performance of 
# the code is with the end user.
# 
$packageDirectory = "C:\AOSService\PackagesLocalDirectory";
foreach($file in Get-ChildItem $packageDirectory)
{
    $folderPath = $packageDirectory + "\" + $file;
    foreach($file in Get-ChildItem $folderPath)
    {    
        $subFolder1 = $folderPath + "\" + $file;
        if ( Test-Path $subFolder1 -PathType Container )
        { 
            foreach($file in Get-ChildItem $subFolder1)
         {
             $subFolder2 = $file;
          $subFolder2Path = $subFolder1 + "\" + $file;
                if($subFolder2 -like "AXUpdate")
                {
              $booleanOutputFolder = $true;
                    foreach($file in Get-ChildItem $subFolder2Path\*.XML)
              {
                        if($booleanOutputFolder -eq $true)
                        {
                            $booleanOutputFolder = $false;
                            Write-Host "Fixes for folder:"$subFolder1;
                        }
                        $xml = [xml](Get-Content $file);
                        Write-Host "Found KB:"$xml.AxUpdate.KBNumbers.string "     Package #:" $xml.AxUpdate.Name;
                  }
                    if($booleanOutputFolder -eq $false)
                    {
                        Write-Host "";
                    }
                }
         }
        }
    }
}
Read-Host -Prompt "Finished: Press Enter to continue" 

 

Comments

*This post is locked for comments