Dot sourcing makes it easy at a later stage to convert your script (s) into a module, you do not have to change script (s) to functions.
Another advantage of a point source is that you can add this function to your shell by adding a file containing functions in Microsoft.PowerShell_profile.ps1, which means you always have access to them (eliminating the need to worry about paths, etc.). d.).
I have a short host entry at the top of my point source files with the name of the function and general parameters, and I dot is the source of the functions in my profile. Each time I open PowerShell, the list of functions in my profile is scrolled (If, like me, you often forget the exact names of your functions / files. You will evaluate this over time, as the number of functions starts to accumulate).
Winfred
source share