The most likely case is that your module is installed in a personal location, and not in a system location. If you run it inside a scheduled task or install it for a specific user (and run it like someone else), you need to make sure that the module is in the βrightβ place.
$env:PSModulePath
Will show the current paths to the module. Must be at least 2. One will be in your user directory, and the other will be in $ pshome \ Modules.
If you want to be lazy, you can place the module there. If you want to be thorough, you can create a new directory, change the PSModulePath (outside PowerShell so that it binds from one PowerShell instance to the next) to include this directory. This is the "official" way.
In a personal note, since you are probably using the very old TaskScheduler module that I wrote in PowerShellPack, I'm sorry that my installer put them in user directories, not global directories. Although user directories are commonplace, global directories should have been an option.
source share