AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.11.2014, 16:25   #1  
Blog bot is offline
Blog bot
Участник
 
25,607 / 848 (80) +++++++
Регистрация: 28.10.2006
As you might have read from the comments on the Cumulative Update 1 for Microsoft Dynamics NAV 2015 has been released post, we are no longer providing the 'hotfix directories' in the hotfix download but some people have hinted that they have the need for them. We have created a PowerShell script that should give you back the same folder structure as was present before, and we are providing the source of the script, so that you can modify it to meet your naming needs.

In order to use it:
  1. Copy the code below to a local file, and save the file as Copy-UpdateFilesToBatchDirectory.ps1.
  2. Unzip the DVD zip file from the Cumulative Update to a local folder.
  3. Run the script.
    1. Open the Microsoft Dynamics NAV 2015 Administration Shell as Administrator
    2. Run this command:
      Import-Module DIRECTORYCopy-UpdateFilesToBatchDirectory.ps1
      where DIRECTORY is the location where you saved the .ps1 file.
    3. Run this command:
      Copy-UpdateFilesToBatchDirectory -DvdDirectory DVDDIRECTORY -BatchDirectory BATCHDIRECTORY
      where DVDDIRECTORY is the location where you unzipped the DVD from the update, and BATCHDIRECTORY is the location where you want to files to be copied to.
  4. It should take a couple of minutes to go through the process, but when done, you should get the same structure as you had before, located in the path you specified for -BatchDirectory
Here is the script:

function Copy-UpdateFilesToBatchDirectory
{
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[string] $DvdDirectory,

[parameter(Mandatory=$true)]
[string] $BatchDirectory
)
PROCESS
{
# Copy all the files from the DVD to a _TEMP folder
Write-Verbose "Copying files from $DvdDirectory to $BatchDirectory_Temp..."
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempRTCAdd-ins
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempNSTAdd-ins
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempBPA
New-Item -ItemType Directory -Force -Path $BatchDirectory_Temp"WEB CLIENT"
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempOUTLOOK
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempADCS
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempHelpServer
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempUpgradeToolKit
New-Item -ItemType Directory -Force -Path $BatchDirectory_TempWindowsPowerShellScripts
Copy-Item $DvdDirectory"RoleTailoredClientprogram filesMicrosoft Dynamics NAV80RoleTailored Client"* -destination $BatchDirectory_TempRTC -recurse -Force
Copy-Item $DvdDirectory"ServiceTierprogram filesMicrosoft Dynamics NAV80Service"* -destination $BatchDirectory_TempNST -recurse -Force
Copy-Item $DvdDirectoryBPA* -destination $BatchDirectory_TempBPA -recurse -Force
Copy-Item $DvdDirectory"WebClientMicrosoft Dynamics NAV80Web Client"* -destination $BatchDirectory_Temp"WEB CLIENT" -recurse -Force
Copy-Item $DvdDirectory"Outlookprogram filesMicrosoft Dynamics NAV80OutlookAddin"* -destination $BatchDirectory_TempOUTLOOK -recurse -Force
Copy-Item $DvdDirectory"ADCSprogram filesMicrosoft Dynamics NAV80Automated Data Capture System"* -destination $BatchDirectory_TempADCS -recurse -Force
Copy-Item $DvdDirectory"HelpServerDynamicsNAV80Help"* -destination $BatchDirectory_TempHelpServer -recurse -Force
Copy-Item $DvdDirectory"UpgradeToolKit"* -destination $BatchDirectory_TempUpgradeToolKit -recurse -Force
Copy-Item $DvdDirectory"WindowsPowerShellScripts"* -destination $BatchDirectory_TempWindowsPowerShellScripts -recurse -Force
Write-Verbose "Done copying files RTC files from $DvdDirectory to $BatchDirectory_Temp."

# Delete files that are not needed for an installation scenario
Write-Verbose "Deleting files from $BatchDirectory that are not needed for the batch directory..."

Get-ChildItem $BatchDirectory_Temp -include '*.etx' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.stx' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.chm' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.hh' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.config' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.stx' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.etx' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.ico' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.flf' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
Get-ChildItem $BatchDirectory_Temp -include '*.sln' -Recurse | Remove-Item -force -ErrorAction SilentlyContinue
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempRTC 'ENU')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempRTC 'en-US')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempRTC 'Images')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempRTC 'SLT')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempRTC 'ReportLayout')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempBPA 'Scripts')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_Temp"WEB CLIENT" 'Resources')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempHelpServer 'css')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempHelpServer 'help')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempHelpServer 'images')
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory_TempWindowsPowerShellScripts 'ApplicationMergeUtilities')
Write-Verbose "Done deleting files from $BatchDirectory that are not needed for for the batch directory."

# Copy the result to the requested directory and remove the _Temp folder
Copy-Item $BatchDirectory_Temp* -destination $BatchDirectory -recurse -Force
RemoveUnnecessaryClickOnceDirectory (Join-Path $BatchDirectory '_Temp')
}
}

function RemoveUnnecessaryClickOnceDirectory
{
param ([string]$directory)
Remove-Item $directory -force -Recurse -ErrorAction SilentlyContinue
}



Hope this helps,

Jorge



Источник: http://feedproxy.google.com/~r/Micro...-update-1.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:54.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.