Streamlining Powershell 2.0 and Task Scheduler + Winscp

Hello,

I am looking for some guidance in which direction I should go for a project I am working on. We currently have approximately 20 scheduled tasks (windows 2003 server) running and scanning folders on various shares to send files outside to other companies and to download files. All of this utilizes winscp. We are looking to streamline all of the processes to 1 or 2 jobs. Our environment will not be on server 2012 for another a while. I was reading the Powershell In Depth 3.0 pdf - Workflows - and I think this would be the route to take? Until such time, what could I do to streamline all of the tasks to 1 or 2 jobs? Would something like Visual Studio, or .Net be viable now? Should I take a VS and .Net course and then incorprate powershell and winscp?

Thanks,
Juneb1022

I am open to all suggestions. I’m not sure what BBcodes are, but I can probably find it. Thank you.

Bulletin Board Code for sending an receiving files? BBCodes are for posting messages. Im not sure how that can help my situation.

I’ve written some scripts using the WinSCP API. It more C# than powershell, but it works great for what we need. Have you seen this link?

Thanks David, I appreciate your reply. I did see the code, yes, Im sure it would work. But strange as this may seem, I am looking to learn more techniques as well, and improve myself along the way, I dont think copying code would help me in the long run.

Without knowing more details it’s impossible to say if workflows would be a good fit.

If you’re just looking to consolidate a bunch of upload/download tasks and run them in parallel a workflow might be overkill.

Since you’re using WinSCP for this, it might be simpler and easier on your system resources to just use Start-Process to launch instances of WinSCP with the necessary command line parameters for each upload or download, and monitor the processes from the main script. You’d probably want to use logging options to log the results to a file and check that after to process completes for error reporting.

Hi Rob,

You are right on, good point.  Making more use of the posh tools is a good habit to do…those “swiss army knives”…get-member, get-process, get-psdrive, get-help. I need to go back to the building blocks.

 

June