logo
  • 教程列表
  • SO官方文檔
  • System.Management.Automation
    • 呼叫簡單的同步管道
  1. StackOverflow 文件
  2. C# Language 教程
  3. System.Management.Automation
  4. 呼叫簡單的同步管道

呼叫簡單的同步管道

Created: November-22, 2018

獲取當前日期和時間。

public class Program
{
    static void Main()
    {
        // create empty pipeline
        PowerShell ps = PowerShell.Create();

        // add command
        ps.AddCommand("Get-Date");

        // run command(s)
        Console.WriteLine("Date: {0}", ps.Invoke().First());

        Console.ReadLine();
    }
}

StackOverflow 文件

  • System.Management.Automation

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明