My son asked me for help creating his own game, after looking into the available options, we ended up choosing MonoGame as a framework.
In the Chapter 7th – MonoGame 2D Game Tutorial, is recommended to create an “atlas” (sprite sheet) with the sprites to speed up the process.
My son already had some sprites he created and initially I was combining them manually using Paint .NET. However, when the number of sprites increased this started to be a repetitive task.
Since I have been working with PowerShell scripting, I decided to write a script that could get all sprites in a folder and combine them in a single file (sprite sheet).
The code is available in GitHub:
https://github.com/uclobby/New-TcMonoGameSpriteSheet
I do recommend installing using PowerShell Gallery we can do this with using PowerShell:
Install-Script New-TcMonoGameSpriteSheet
The output should look like this:

Before we execute the script, we need to be aware that this script assumes a folder structure like this:

I am mentioning this because the way that the script works is using the specified path, in this case Sprites, and generate a sprite sheet per folder inside the Sprites folder.
New-TcMonoGameSpriteSheet.ps1 -Path "D:\TugaCode\Content\Sprites"

Please note that all sprite names will go lowercase, this is to avoid misspelled names.
Another consideration to have in mind, is the animation element in XML is created by any sprite that has NAME-NUMBER, this means that animations might require xml modifications after the script is executed.
In the MonoGame the Animations in XML look like this:
<Animations>
<Animation name="slime-animation" delay="200">
<Frame region="slime-1" />
<Frame region="slime-2" />
</Animation>
<Animation name="bat-animation" delay="200">
<Frame region="bat-1" />
<Frame region="bat-2" />
<Frame region="bat-1" />
<Frame region="bat-3" />
</Animation>
</Animations>
In the XML file generated by the script it will just be a sequence:
<Animations>
<Animation name="bat-animation" delay="200">
<Frame region="bat-1"/>
<Frame region="bat-2"/>
<Frame region="bat-3"/>
</Animation>
<Animation name="slime-animation" delay="200">
<Frame region="slime-1"/>
<Frame region="slime-2"/>
</Animation>
</Animations>
As we can see the bat sequence is not correct. So please don’t forget to adjust the animations with the correct sequence.
PowerShell Gallery
https://www.powershellgallery.com/packages/New-TcMonoGameSpriteSheet
GitHub:
https://github.com/uclobby/New-TcMonoGameSpriteSheet