Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using F# script replace powershell in production environment?

Tags:

powershell

f#

I've been using powershell script to automate some tasks on production servers. However, it reaches its limitation when I try to do something about async and parallel processing, etc.

Is F# script a good to replace powershell script? (Guess it will be more cumbersome when access file system and other other OS objects, which is very easy in Powershell). The servers don't have visual studio installed. Is it OK just copy fsi.exe to the server to run the fsx files?

A use case,

  1. Download big zip files from a slow FTP server
  2. Unzip the files
  3. Execute an executable files to process the unzipped files

each steps take a while so I want to do something like the following which is hard to do it in powershell

//Limit download 3 files at the same time maximum.
async {
  let! zip = GetFromFTP ...
  let! file = Unzip zip
  do! ... //Run exe to parse file
}
like image 382
ca9163d9 Avatar asked May 11 '15 15:05

ca9163d9


1 Answers

You may find FAKE even more useful that just fsi.exe. It automates builds, but it is just an .fsx file with different targets that could be run from a command line.

like image 151
V.B. Avatar answered Oct 01 '22 02:10

V.B.