For a function that is stored in a .ps1 file, you will have to dot-source the .ps1 file.
In other words, feed the function definition to the PowerShell engine, so you can call it later on.
For that do
. ./FolderByPath.ps1
Note that there is a blank between the 2 dots.