$ApplicationObjectFile = "";
$ModifiedIdentifier = "";
$OriginalIdentifier = "";
$TargetIdentifier = ""
$PathForMicrosoftDynamicsNavManagement = "";
$PathForMicrosoftDynamicsNavModelTools = "";
Import-Module $PathForMicrosoftDynamicsNavManagement
Import-Module $PathForMicrosoftDynamicsNavModelTools -DisableNameChecking
$Delta = "DELTA";
$Modified = "MODIFIED" + $ModifiedIdentifier;
$Original = "ORIGINAL" + $OriginalIdentifier;
$Target = "TARGET" + $TargetIdentifier;
$Result = "RESULT";
$DeltaPath = $ApplicationObjectFile + $Delta;
if (!(Test-Path $DeltaPath)) {
New-Item -ItemType directory -Path $DeltaPath;
}
$DeltaPath += "\";
$ResultPath = $ApplicationObjectFile + $Result;
if (!(Test-Path $ResultPath)) {
New-Item -ItemType directory -Path $ResultPath;
}
$ResultPath += "\";
$TargetPath = $ApplicationObjectFile + $Target;
if (!(Test-Path $TargetPath)) {
New-Item -ItemType directory -Path $TargetPath;
}
$TargetPath += "\";
$ModifiedPath = $ApplicationObjectFile + $Modified;
if (!(Test-Path $ModifiedPath)) {
New-Item -ItemType directory -Path $ModifiedPath;
}
$ModifiedPath += "\";
$OriginalPath = $ApplicationObjectFile + $Original;
if (!(Test-Path $OriginalPath)) {
New-Item -ItemType directory -Path $OriginalPath;
}
$OriginalPath += "\";
$ModifiedFile = $ApplicationObjectFile + $Modified + ".txt";
Split-NAVApplicationObjectFile -Source $ModifiedFile -Destination $ModifiedPath -PreserveFormatting;
$OriginalFile = $ApplicationObjectFile + $Original + ".txt";
Split-NAVApplicationObjectFile -Source $OriginalFile -Destination $OriginalPath -PreserveFormatting;
$TargetFile = $ApplicationObjectFile + $Target + ".txt";
Split-NAVApplicationObjectFile -Source $TargetFile -Destination $TargetPath -PreserveFormatting;
Merge-NAVApplicationObject -ModifiedPath $ModifiedPath -OriginalPath $OriginalPath -ResultPath $ResultPath -TargetPath $TargetPath