Last active
December 13, 2017 17:33
-
-
Save MNie/35f43e66e68d300510ca3a6c308d06fd to your computer and use it in GitHub Desktop.
Short example of how to install all packages from packages.config via single command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Data | |
type packages = XmlProvider<"""<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="Machine.Fakes.RhinoMocks" version="2.3.0" targetFramework="net462" /> | |
<package id="Machine.Specifications" version="0.9.3" targetFramework="net462" /> | |
<package id="Machine.Specifications.Should" version="0.7.2" targetFramework="net462" /> | |
<package id="RhinoMocks" version="3.6.1" targetFramework="net462" /> | |
</packages>"""> | |
[<EntryPoint>] | |
let main argv = | |
let p = | |
packages.Load(argv.[0]).Packages | |
|> Seq.map (fun x -> sprintf "\"Update-Package %s -version %s -ProjectName %A\" -reinstall" x.Id x.Version.Value argv.[1]) | |
|> String.concat "," | |
printfn "%s" p | |
0 | |
// run program: program.exe "path to packages.config file" "project name" | |
// copy result | |
// Open Package.Manager.Console | |
// assign to $packages copied result -> $packages = ... | |
// run: $packages | foreach { Invoke-Expression $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment