- 1. Tables
- 2. Reports
- 3. Codeunits
- 4. XMLports
- 5. MenuSuites
- 6. Pages
- 7. Queries
Mit dem Cmdlet Join-NAVApplicationObjectFile wird die Gruppierung beim Zusammensetzen leider verändert, da kommen dann die Reports zuerst usw. was direkte Abgleiche gegen die aus einer Datenbank exportierten Ausgangsbasis dann unmöglich macht.
Alte Dateien aus älteren Läufen werden vom Skript vorab gelöscht.
Mit dem Boolean-Parameter kann man steuern, ob die einzelnen Objekttypdateien erhalten bleiben (0) oder gelöscht (1) werden.
- Code: Alles auswählen
function CreateSortedNAVObjectPackage{
param ([Boolean]$DeleteSeparateObjectFiles)
BEGIN{}
PROCESS {
Write-Host "Deleting old object files…"
IF (Test-Path .\allobjects.txt) {Remove-Item .\allobjects.txt}
IF (Test-Path .\alltables.txt) {Remove-Item .\alltables.txt}
IF (Test-Path .\allreports.txt) {Remove-Item .\allreports.txt}
IF (Test-Path .\allcodeunits.txt) {Remove-Item .\allcodeunits.txt}
IF (Test-Path .\allxmlports.txt) {Remove-Item .\allxmlports.txt}
IF (Test-Path .\allmenusuites.txt) {Remove-Item .\allmenusuites.txt}
IF (Test-Path .\allpages.txt) {Remove-Item .\allpages.txt}
IF (Test-Path .\allqueries.txt) {Remove-Item .\allqueries.txt}
Write-Host "Joining discrete NAV object files…"
Join-NAVApplicationObjectFile -Source .\TAB*.txt -Destination alltables.txt
Join-NAVApplicationObjectFile -Source .\REP*.txt -Destination allreports.txt
Join-NAVApplicationObjectFile -Source .\COD*.txt -Destination allcodeunits.txt
Join-NAVApplicationObjectFile -Source .\XML*.txt -Destination allxmlports.txt
Join-NAVApplicationObjectFile -Source .\MEN*.txt -Destination allmenusuites.txt
Join-NAVApplicationObjectFile -Source .\PAG*.txt -Destination allpages.txt
Join-NAVApplicationObjectFile -Source .\QUE*.txt -Destination allqueries.txt
Write-Host "Concatenating object files into the AllObjects.txt…"
IF (Test-Path .\alltables.txt) {Add-Content -path AllObjects.txt -value(Get-Content alltables.txt)}
IF (Test-Path .\allreports.txt) {Add-Content -path AllObjects.txt -value(Get-Content allreports.txt)}
IF (Test-Path .\allcodeunits.txt) {Add-Content -path AllObjects.txt -value(Get-Content allcodeunits.txt)}
IF (Test-Path .\allxmlports.txt) {Add-Content -path AllObjects.txt -value(Get-Content allxmlports.txt)}
IF (Test-Path .\allmenusuites.txt) {Add-Content -path AllObjects.txt -value(Get-Content allmenusuites.txt)}
IF (Test-Path .\allpages.txt) {Add-Content -path AllObjects.txt -value(Get-Content allpages.txt)}
IF (Test-Path .\allqueries.txt) {Add-Content -path AllObjects.txt -value(Get-Content allqueries.txt)}
IF (($DeleteSeparateObjectFiles -and (Test-Path alltables.txt))) {Remove-Item alltables.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allreports.txt))) {Remove-Item allreports.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allcodeunits.txt))) {Remove-Item allcodeunits.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allxmlports.txt))) {Remove-Item allxmlports.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allmenusuites.txt))) {Remove-Item allmenusuites.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allpages.txt))) {Remove-Item allpages.txt}
IF (($DeleteSeparateObjectFiles -and (Test-Path allqueries.txt))) {Remove-Item allqueries.txt}
}
END{}
}
Wie ĂĽblich in der Profildatei hinterlegen und zum schnellen Aufrufen einen Alias z.B. csnop dazu
- Code: Alles auswählen
Set-Alias csnop CreateSortedNAVObjectPackage