Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Executing Powershell through Batch

$
0
0
I am new to powershell and wanted to automate the existing .ps1 script using the Batch file. I wanted to seek help for the execution of Powershell through Batch script as my existing script didn't work. Below is the batch script for your view.
My batch file is:
echo "Changing the execution policy"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command {Set-ExecutionPolicy} > C:\Temp\a.out

echo "Updating the Server details:"

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "D:\test\Bluebird_1.2.0_RTM\ReplaceTagsOnConfigFiles.ps1;REPLACE" > C:\Temp\b.out
The powershell program is attached herewith.
When I try to execute the above batch file, the log file is empty and no error is thrown. Could you please help me in this regard.
(Please visit the site to view this media)

Viewing all articles
Browse latest Browse all 6937

Trending Articles