Calling powershell cmdlets from Windows batch file

后端 未结 6 1141
青春惊慌失措
青春惊慌失措 2020-12-08 21:14

Ok something so simple is just not working for me. I got a cmdlet that accepts a single parameter. I am trying to call a cmdlet within a Windows batch file. The batch fil

6条回答
  •  不思量自难忘°
    2020-12-08 21:46

    Starting with Powershell version 2, you can run a Powershell script like so...

    powershell -ExecutionPolicy RemoteSigned -File "C:\Path\Script.ps1" "Parameter with spaces" Parameter2
    

    Now if I could only figure out a way to handle dragging and dropping files to a Powershell script.

提交回复
热议问题