PowerShell: Load a Script
Run a script in its own scope
# run script with full path ~/temp/myscript.ps1
if scriptPath is a file name in current dir, you need to put ./ in front.
# run script in current dir ./myscript.ps1
Run a script in current session scope (Dot sourcing operator)
this loads the script into current session, meaning, all variable and function are imported into the current session.
. scriptPath
. ./myscript.ps1