Porting Unix Shell Script to PowerShell

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.

The most fitting answer to this question would be: ‘It depends’. :wink: … 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. :wink:

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.

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?