Powershell command Sync-NavTenant list is truncated

  • Powershell command Sync-NavTenant list is truncated

    Posted by Jason Wilder on April 10, 2019 at 8:20 am
    • Jason Wilder

      Member

      April 10, 2019 at 8:20 AM

      In upgrading to NAV 2018 one of the steps is to “Sync Schema for All Tables” which can be done from Dev environment or Powershell.Ā  Powershell is better since you can see the output.Ā  So when running this command: Sync-NavTenant [YourServiceTierName] -Mode Sync if there are destructive changes it rolls back and lists all of the tables and fields that are being changed or deleted like this for example:
      Table: 111, Sales Shipment Line
      Field: 84012, Return Item No.: Deleted
      Table: 113, Sales Invoice Line
      Field: 84012, Return Item No.: Deleted
      Table: 355, Ledger Entry Dimension
      Field: 1, Table ID: Data type changed
      Field: 2, Entry No.: Data type changed
      Field: 3, Dimension Code: Data type changed
      Field: 4, Dimension Value Code: Data type changed
      etc…

      This is totally expected during an upgrade and is typically resolved by using an upgrade codeunit.Ā  Turns out that due to our add-on’s there are so many changes to list that it truncates the list and I can’t see all the changes.Ā  Just as an aside, not a single one of our add-on’s included an upgrade codeunit with their product to resolve this (not cool).Ā 

      So my question is this:Ā  Isn’t there a way to run a powershell command to a file instead of the screen which would most likely end up creating the full list?Ā  Or some other way to see the full results from the Sync-NavTenant command.

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————

    • Mathew Ealy

      Member

      April 11, 2019 at 7:44 AM

      Add the out-file command to your script.
      Sync-NavTenant [YourServiceTierName] -Mode Sync -verbose | Out-File -FilePath C:Sync.txt

      ——————————
      Mathew Ealy
      Nav Support Specialist
      Rentokil N. America
      Reading PA
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      April 12, 2019 at 7:23 AM

      Exactly what I was looking for, thanks!

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      April 12, 2019 at 8:13 AM

      I spoke too soon.Ā  This:
      Sync-NavTenant DynamicsNAV110-2 -Mode CheckOnly -verbose Out-File -FilePath “C:binSync.txt”

      causes this error:

      A positional parameter cannot be found that accepts argument ‘Out-File’.

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————
      ——————————————-

    • Mathew Ealy

      Member

      April 12, 2019 at 8:22 AM

      you need to include the pipe | , you are sending the output of the first commandĀ  to the out-file powershell command.

      ——————————
      Mathew Ealy
      Nav Support Specialist
      Rentokil N. America
      Reading PA
      ——————————
      ——————————————-

    Jason Wilder replied 6 years, 4 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Powershell command Sync-NavTenant list is truncated’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!