Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Formatting ShareGate Log Files in Excel with PowerShell
June 12
Formatting ShareGate Log Files in Excel with PowerShell

Hi All,

Today, I want to share a handy PowerShell function I developed recently to enhance readability of ShareGate log files.

If you are using ShareGate for SharePoint migrations or management tasks, you might be familiar with the extensive Excel logs produced by ShareGate. While these logs are rich in details, they can sometimes be too rich in details. They often require some formatting for better readability or to highlight the necessary details. When doing a lot of migrations I found myself doing the same steps over and over again to these logs. Being lazy, I thought, “Someone should automate this!”. I sat down with my buddy PowerShell and this is what we came up with.

This function, Format-ShareGateLogFile, tackles this by opening a ShareGate log file in Excel format and applying a few changes. It does this by using Doug Finke’s excellent ImportExcel PowerShell Module. It adds a table to the first worksheet, formats the first column as "Date-Time", calculates the duration of the log file, and formats the duration as "[h]:mm:ss" in the last row. Finally, it saves the changes and closes the Excel file.

To use this function, you’ll have to download Logfiles.psm1 from my Github Repo. Then use Import-Module to import it into your PowerShell session.

After that’s done you can run Format-ShareGateLogFile. You will need to provide the path to the Excel file to format as an argument to the Path parameter, which is mandatory. For instance,

PS C:\> Format-ShareGateLogFile -Path "C:\path\to\ShareGateLogFile.xlsx"

This will format the Excel file located at "C:\path\to\ShareGateLogFile.xlsx" for readability.

The function also accepts two optional switches: Open and HideColumns. If you use the Open switch, the function will open the formatted Excel file automatically after it has finished formatting. The HideColumns switch will hide specified columns (E-U, W-AR, AT-BA) in the Excel file. For instance,

PS C:\> Format-ShareGateLogFile -Path "C:\path\to\ShareGateLogFile.xlsx" -HideColumns -Open

This will format the Excel file, hide the specified columns, and open the Excel file automatically after it has been formatted.

One neat feature of the function is that it can accept pipeline input for the `Path` parameter. This means you can pipe in a series of file paths to the function and it will format each file in turn. For instance,

PS C:\> Get-ChildItem -Path "C:\path\to\folder" -Filter "*.xlsx" | Format-ShareGateLogFile -HideColumns -Open

This will get all the Excel (.xlsx) files in the specified folder, and for each one, it will be formatted for readability, with specified columns hidden, and the Excel file opened automatically after it has been formatted.

This function has saved me heaps of time while working with ShareGate log files, and I hope it does the same for you. Happy scripting!





Welcome to the future of modern living atResidences™@Jurong East Central 1! If you're searching for a sophisticated, comfortable, and convenient living space in the heart of Singapore, your quest ends here. In this article, we'll delve into what makes J'Den Residences™ an exceptional choice for both homebuyers and investors.jden
 on 10/3/2023 1:21 AM

Re: Formatting ShareGate Log Files in Excel with PowerShell

Websites is normally bogged off by means of untrue blog without having any substantial subject matter however, the key content was first terrific and additionally sensible all the look at. With thanks just for stating this approach by himself.실시간카지노타이틀카지노/
 on 10/7/2023 5:18 AM


In the ever-evolving world of online gambling, finding a reliablecan feel like navigating a maze of choices. Whether you're a seasoned player or new to the scene, the quest for the perfect online casino experience can be daunting. That's where Casino Mania steps in – we are passionate casino enthusiasts committed to guiding you through the vast landscape of online gaming. Our mission? To recommend safe and exciting casino sites, delve into the world of Baccarat, and immerse you in the thrill of live casino action.카지노사이트
 on 10/7/2023 7:52 AM


Are you ready to embark on a fitness journey that aligns with your goals, lifestyle, and individual needs? Look no further than Motive Training in Grand Rapids, MI. As your premier destination for personal training, we're here to redefine your fitness experience, ensuring you  towards your desired outcomes.Move with Purpose
 on 10/7/2023 9:07 AM

Re: Formatting ShareGate Log Files in Excel with PowerShell

World of warcraft! What precisely tabs opener the place has long been in my situation. Considerably preferred, bookmarked as their favorite, That i can’t look forward to even more!sbobet
 on 10/9/2023 8:48 AM


Explore the Latest Trends in Women's Fashion at Pink Seal. Click here to discover your new style!Trending bottoms & Stacked jeans
 on 10/10/2023 1:18 AM

Re: Formatting ShareGate Log Files in Excel with PowerShell

Carry on the great operate, My spouse and i go through number of blogposts for this site along with I do think that your particular world wide web web site can be true exciting and possesses acquired encircles involving amazing data.Blue Vibe CBD Gummies
 on 10/10/2023 2:19 AM


A faulty oven can hamper your cooking endeavors and ruin mealtime plans. Profixx Appliance Repair provides reliable  Ontario. Whether it's a malfunctioning heating element, a faulty thermostat, or an ignition problem, our technicians can identify the issue and repair it promptly. Don't let a malfunctioning oven affect your culinary adventures – explore more about our oven repair services today.Oven Repair London Ontario
 on 10/10/2023 10:45 PM

Re: Formatting ShareGate Log Files in Excel with PowerShell

Looking for the best online business india? Join Livegood With Gary on Telegram for expert guidance and a supportive community. Learn more and explore our website!best online business india
 on 10/11/2023 1:32 AM


Looking for a top-notch CNC machine shop near you? Suwanee Machine Shop in Suwanee, GA, is your trusted partner for machining, welding, and fabrication. Visit us today!machine shop
 on 10/11/2023 2:11 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person


Want a message when I reply to your comment? Put your Twitter handle here.