以假冒的方式执行Powershell脚本

Adr*_*ell 9 powershell f# f#-fake

在Fake构建自动化工具中执行Powershell脚本的最佳方法是什么?

我觉得这个问题应该有一个明显的答案,但是通过搜索找不到任何东西.

Lea*_*and 16

正如您在评论中提到的那样,使用该PowerShell课程非常简单.

#r "FakeLib.dll"
#r "System.Management.Automation"

open Fake
open System.Management.Automation

Target "RunSomePowerShell" <| fun _ ->
    PowerShell.Create()
      .AddScript("(Get-Process | ? ProcessName -eq 'chrome' | measure WorkingSet -Average).Average")
      .Invoke()
      |> Seq.iter (printfn "%O")
Run Code Online (Sandbox Code Playgroud)