Skip to content

Instantly share code, notes, and snippets.

@jamescrowley
Created July 16, 2014 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamescrowley/963b0ad8db2f162a87f7 to your computer and use it in GitHub Desktop.
Save jamescrowley/963b0ad8db2f162a87f7 to your computer and use it in GitHub Desktop.
PowerShell / F# Make weirdness
Target "PowerShell" (fun _ ->
let result = ExecProcess (fun info ->
info.FileName <- "powershell.exe"
info.WorkingDirectory <- (currentDirectory @@ "deploy")
info.Arguments <- "-ExecutionPolicy RemoteSigned -Command \"Import-Module Carbon\"") System.TimeSpan.MaxValue
if result <> 0 then failwithf "Error deploying local"
)
powershell -ExecutionPolicy RemoteSigned -Command "Import-Module Carbon"
@jamescrowley
Copy link
Author

The exception is below. Carbon is installed to C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Carbon

Import-Module : The specified module 'Carbon' was not loaded because no valid module file was found in any module
directory.
At line:1 char:1
+ Import-Module Carbon
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Carbon:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Running build failed.
Error:
System.Exception: Error deploying local
   at FSI_0001.Build.clo@49-14.Invoke(String message) in D:\BuildAgent\work\969a7c32f8e58f6a\build.fsx:line 49
   at Fake.TargetHelper.runTarget@314(String targetName) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment