最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

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

网络文摘 William 1560浏览 0评论

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" 

 

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址