Compare-NAVApplicationObject

Compare-NAVApplicationObject

Compares text files with Microsoft Dynamics NAV application objects and then calculates the delta between the two versions. The result of the comparison is a number of text files with the calculated delta.

Syntax

Parameter Set: Default
Compare-NAVApplicationObject [-OriginalPath] <String[]> [-ModifiedPath] <String[]> [-DeltaPath] <String> [-Confirm] [-Force] [-Legacy] [-NoCodeCompression] [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Use the Compare-NAVApplicationObject cmdlet to calculate the delta between one version of Microsoft Dynamics NAV application objects and another version. The deltas can later be applied to a third version by using the Update-NAVApplicationObject cmdlet.

The Compare-NAVApplicationObject cmdlet compares the text files in the two specified folders and creates .delta files that describe the difference between the two versions. The text files must contain Microsoft Dynamics NAV application objects that have been exported from the Microsoft Dynamics NAV Development Environment. You can compare two text files that contain multiple application objects, and you can compare text files in two folders where each text file can contain one or more application objects. The cmdlet creates a text file for each application object that is different between the two versions.

For example, you compare two versions of table 27: an original version and a modified version. The modified version has added a field to the table compared to the original version. In this example, the Compare-NAVApplicationObject cmdlet creates a delta file,TAB27.delta, that describes the difference that the extra field must be inserted into the table. Then, you use Update-NAVApplicationObject cmdlet to apply the delta to target files.

Parameters

-Confirm

Specifies that the user must confirm the process before the cmdlet runs.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DeltaPath<String>

Specifies the folder where the result of the comparison between the two versions of application objects must be put.

For example, to place the result of the comparison in the DELTA folder that is a subfolder to the current folder, type .\DELTA\*.txt.

Aliases

Delta

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Forces the cmdlet to overwrite any existing files in the Delta folder.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Legacy

Reduces the scope of the cmdlet. Do not set this parameter.

Aliases

DevBaseCompatibility

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ModifiedPath<String[]>

Specifies the application objects that you want to compare to the original version.

For example, to compare all text files in the MODIFIED folder that is a subfolder to the current folder, type .\MODIFIED\*.txt.

Aliases

Modified

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoCodeCompression

Specifies if the files that are the result of the comparison must not be compressed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OriginalPath<String[]>

Specifies the application objects that are the baseline of the file comparison.

For example, to use all text files in the ORIGINAL folder that is a subfolder to the current folder, type .\ORIGINAL\*.txt.

Aliases

Original

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Specifies if the cmdlet must return a FileInfo object for each .delta file that is created by the comparison. If you do not set this parameter, the cmdlet returns a list of the files.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None or an object representing the .DELTA file that was created.

    When you set the PassThru parameter, the Compare-NavApplicationObject cmdlet returns a FileInfo object for each created .DELTA file. Otherwise, this cmdlet does not generate any output.

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This example compares the text files in the MODIFIED folder to the baseline in the ORIGINAL folder. The result of the comparison is put into the DELTA folder. When the comparison completes, a summary is shown.

PS C:\> Compare-NAVApplicationObject –OriginalPath C:\Solution\ORIGINAL\*.txt -ModifiedPath C:\Solution\MODIFIED\*.txt -DeltaPath C:\Solution\DELTA
Processed 14 objects: 
  Inserted   0 objects
  Deleted    1 objects
  Changed    4 objects
  Identical  9 objects
  Failed     0 objects

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This example compares the text files in the MODIFIED folder to the baseline in the ORIGINAL folder. The result of the comparison is put into the DELTA folder and also piped to the Update-NAVApplicationObject cmdlet, which applies the updates. When the comparison completes, a summary is shown.

PS C:\> Compare-NAVApplicationObject -OriginalPath .\ORIGINAL\*.txt -ModifiedPath .\MODIFIED\*.txt -DeltaPath .\DELTA -Force -PassThru |
    Update-NAVApplicationObject -TargetPath .\TARGET\*.txt -ResultPath .\RESULT -Force
Processed 14 objects: 
  Inserted   0 objects
  Deleted    1 objects
  Updated    3 objects
  Identical  9 objects
  Conflict   1 objects
  Failed     0 objects