Run All PowerShell Scripts In A Directory

前端 未结 1 990
情书的邮戳
情书的邮戳 2021-02-11 01:54

I have a series of ps1 files in a directory, all of which have different names. I am trying to run them one after another with Start-Process and the -Wait

1条回答
  •  逝去的感伤
    2021-02-11 02:34

    You could simply use the call operator (&):

    Get-ChildItem 'C:\test' | ForEach-Object {
      & $_.FullName
    }
    

    0 讨论(0)
提交回复
热议问题