Skip to content

Instantly share code, notes, and snippets.

@OnorioCatenacci
Created November 11, 2011 20:11
Show Gist options
  • Save OnorioCatenacci/1359087 to your computer and use it in GitHub Desktop.
Save OnorioCatenacci/1359087 to your computer and use it in GitHub Desktop.
Quick Powershell Script For Running Fsharp Shell Scripts
#11 November 2011
#ExecFsx.ps1
#Onorio Catenacci
#Insure we get all the error checking from Powershell itself that we can
set-strictmode -version latest
#Set this to point at the location of fsi.exe on your machine.
set-variable -name fsi -value """$env:ProgramFiles\Microsoft F#\v4.0\fsi.exe""" -option constant
#This is where I put all of my .fsx files. Change this to your favorite location
set-variable -name FSharpScriptHome -value "$env:HomeDrive$env:HomePath\My Documents\FSharpHacks" -option constant
function ExecuteFSharpShellScript ([string] $scriptName)
{
start-process $fsi -argumentlist "--exec ""$FSharpScriptHome\$scriptName"""
}
#Example: .\ExecFsx.ps1 Build.fsx
ExecuteFSharpShellScript($args[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment