13.11.2014, 16:25 | #1 |
Участник
|
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:
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, напишите личное сообщение администратору. |
|