If I want to separate out some of my functionality from my main PowerShell script, I can either write that as a .ps1
file and dot source the same or I can create th
Dotsourcing + script and modules are 2 different things. Modules are great to collect/group functions and cmdlets that you would use in a script. If you have functions that you want to use interactively(you call a function in a console), then module can be a great fit.
If you have one big script that you run to .. let's say "migrate a file share", or a single script that you call regulary using Task Scheduler, then dot-sourcing easier.
It depends on what you need. Summary: