[英]Executing a Powershell Script in Fake
在Fake構建自動化工具中執行Powershell腳本的最佳方法是什么?
我覺得這個問題應該有一個明顯的答案,但是通過搜索找不到任何東西。
正如您在評論中提到的那樣,使用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")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.