I\'m trying to execute a powershell from a batch file with the commande: Powershell .\\nameoffile.ps1
The PowerShell returns some values 1, 4, 0 and -1 . How can I get t
What about something like this?
test.bat
@echo off
powershell .\test.ps1 >output.log
type output.log
It just redirects the output of the powershell script to a text file and then outputs the contents of the text file to the console.
Here is my test.ps1 file
Write-Output "Hello World"
Exit
And here is the output:
C:\temp\batchtest>test.bat
Hello World
C:\temp\batchtest>