Streamlining Powershell 2.0 and Task Scheduler + Winscp

This topic contains 6 replies, has 3 voices, and was last updated by Profile photo of juneb1022 juneb1022 3 years, 10 months ago.

  • Author
    Posts
  • #7214
    Profile photo of juneb1022
    juneb1022
    Participant

    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

  • #7235
    Profile photo of juneb1022
    juneb1022
    Participant

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

  • #7241
    Profile photo of juneb1022
    juneb1022
    Participant

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

  • #7247
    Profile photo of David Christian
    David Christian
    Participant

    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?
    http://winscp.net/eng/docs/library_powershell#example

  • #7252
    Profile photo of juneb1022
    juneb1022
    Participant

    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.

  • #7254
    Profile photo of Rob Campbell
    Rob Campbell
    Participant

    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.

  • #7374
    Profile photo of juneb1022
    juneb1022
    Participant

    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

     

     

     

You must be logged in to reply to this topic.