Porting Unix Shell Script to PowerShell

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of amit aman amit aman 1 week, 2 days ago.

  • Author
    Posts
  • #58279
    Profile photo of amit aman
    amit aman
    Participant

    Hi Team,

    we have a requirement to port 250+ Unix Shell scripts to Windows. These scripts perform operations like file operation (validate header info), move files, encrypt/decrypt, e-mail notify, file watcher, archival etc. Need your help on two points:

    a) Currently below 3 options have been suggested.

    • Finalize on Tool Options

    – Cygwin – open source; no support contract
    – MKS Toolkit
    – Windows PowerShell

    b) Considering higher chance of PowerShell being chosen, Would you be able to provide any insights if any conversion tool can be used. If not, what is the complexity of porting the shell scripts to Windows.

    Thanks in Advance.

  • #58352
    Profile photo of Olaf Soyk
    Olaf Soyk
    Participant

    The most fitting answer to this question would be: 'It depends'. 😉 ... and I think it depends on several conditions.

    I only have superficial knowledge about Linux or Unix but I would recommend NOT to port your scripts and especially not by a conversion tool or saomething like this. I think because of the completely different philosophies behind Powershell and Unix shell scripts it will be probably more reliable and much better maintainable to rewrite what you need in 'native' Powershell. Probably your scripts will be anyway less bulky in Powershell.

    And ... probably you will not find that many Unix or Linux admins in this forum. 😉

  • #58355
    Profile photo of Ron
    Ron
    Participant

    I can't imagine those 250+ scripts all perform unique tasks. Rewriting from scratch will give you a chance to reduce them to a manageable number. I'm just speculating, but I would guess there are many that perform the same task but on different machines, or directories, etc, things that could have been passed as parameters instead.

  • #58484
    Profile photo of amit aman
    amit aman
    Participant

    Thanks a ton Ron and Olaf for the clarification. One more doubt I have. Don't we have any COM object which may be used for this purpose?

You must be logged in to reply to this topic.