Hi,
Only the powershell session created by the scheduled task will dot source the script. If you want your powershell to dot source the script automatically you can add . c:\functions.ps1
to the powershell profile $Home[My ]Documents\WindowsPowerShell\Profile.ps1
https://devblogs.microsoft.com/scripting/understanding-the-six-powershell-profiles/
Best Regards,
Ian
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.