Function not recognized at startup
I created the "Get-Uptime" function in the sysinfo.psm1 module and imported the module.
C:/pstools> get-command -Module sysinfo CommandType Name Definition ----------- ---- ---------- Function Get-Uptime ... The function worked fine in Powershell. However, whenever I used the Get-Uptime function in Start-job -scriptblock {Get-Uptime $ servernae}, the operation failed with the following error
Receive-Job : The term 'get-uptime' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Can someone please let me know what I missed? I searched the network and found a suggestion to write all the codes in the script block instead of using the function, but I tried and received similar errors.
Thanks.