Hello
I am trying to schedule a function that checks disk space on servers. To run the function I am likely not doing it the best way as I run:
1. import-module .\get-freespace.ps1
2. .\get-freespace.ps1 -computers c:\scripts\computers.txt -To jake@test.local -From schedtask@test.local -smtpserver mail.test.local
I’ve tried changing this to a .psm1 as a module, but running it manually I get an error that it’s “unknown”, and I realize I should change it to a .psm1 and then edit the “myfunctions” file in my profile, is that right?
I’ve tried running it in a batch file and also from within another posh script using the dot source method, but I can’t get this function or any function to work like that.
I’m using powershell 3.0 on Windows 2012.
Thanks!
Jake