• Michael Intravartolo

Understanding PowerShell resultsets



Whether you like it or not, if you want to be a successful Dynamics NAV developer in the future you have to understand PowerShell. So do I.

Currently I am working on an integration project where we make an interface between an external solution and NAV using WebServices. The idea is to ship the software with Delta files instead of a fob.

So I am running my PowerShell and notice some differences between NAV 2013R2 and NAV 2015.

This is what I run:

NAV 2013 R2

$MergeResult = Update NAVApplicationObject - Target “C:\Users\Mark Brummel\Documents\DynamicsNAVNA71\Files\” `

-Delta “C:\Users\Mark Brummel\Documents\Delta\” `

-Result “C:\Users\Mark Brummel\Documents\New Object\” -Force

NAV 2015

$MergeResult = Update-NAVApplicationObject -TargetPath “C:\Users\Mark Brummel\Documents\DynamicsNAVNA80\Files\” `

-DeltaPath “C:\Users\Mark Brummel\Documents\Delta\” `

-ResultPath “C:\Users\Mark Brummel\Documents\New Object 80\” -Force

As you can see the parameters have changed, but so has the resultset.

Unfortunatley there is not much documentation on the resultset, only on the cmdlet parameters.

But I ran into a vide from Graaf that shows this:

$MergeResult | Get-Member

This returns with a list with the object members.

NAV 2013R2

Name MemberType Definition

—- ———- ———-

Equals Method bool Equals(System.Object obj)

GetHashCode Method int GetHashCode()

GetType Method type GetType()

ToString Method string ToString()

Conflict Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Conflict {get;}

Error Property Microsoft.Dynamics.Nav.Model.Tools.ErrorInfo Error {get;}

Id Property int Id {get;}

ObjectType Property string ObjectType {get;}

Result Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Result {get;}

UpdateResult Property Microsoft.Dynamics.Nav.Model.Tools.UpdateResult UpdateResult {get;}

NAV 2015:

Name MemberType Definition —- ———- ———-

Equals Method bool Equals(System.Object obj)

GetHashCode Method int GetHashCode()

GetType Method type GetType()

ToString Method string ToString()

PSPath NoteProperty System.String PSPath=C:\Users\Mark Brummel\Documents\New Object 80\COD84001.TXT

Conflict Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfoConflict {get;}

Error Property Microsoft.Dynamics.Nav.Model.Tools.ErrorInfo Error {get;}

Id Property int Id {get;}

ObjectType Property string ObjectType {get;}

Result Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfoResult {get;}

UpdateResult Property Microsoft.Dynamics.Nav.Model.Tools.UpdateResultUpdateResult {get;}

So as you can see (I hope) the Path is missing in NAV 2013R2.

What I ended up doing is using the NAV 2015 cmdlet for NAV 2013R2 objects. There is probably a smart way to figure out a filename from the other properties.

Challenge for someone?

#microsoftdynamicsnav

0 views
Contact Us

Solution Systems, Inc.

3201 Tollview Dr. 

Rolling Meadows, IL 60008

Office: 847-590-3000

Email: info@solsyst.com

Support: 224-345-2020

Support Email: support@solsyst.com

Connect With Us
  • Manufacturing Software | Illinois
  • Manufacturing Software | Illinois
  • Manufacturing Software | Illinois
  • Manufacturing Software | Illinois
  • Manufacturing Software | Chicago
  • Manufacturing Software | Illinois
  • Microsoft Business Podcast
  • Manufacturing Software | Chicago
  • Manufacturing Software | Chicago
  • Manufacturing Software | Chicago
Join our Mailing List

© 2020 Solution Systems, Inc.