Bravo 7555
asked on
powershell script
Created a task to run a powershell script automatically. When i run the task the powershell runs, but it gets stuck at the prompt to hit R for Run once S for Suspend or ? Help.
How do I get the script to answer the prompt automatically with R each time?
Example of my script: -file C:\Netwrix_Auditor_Add-on_ for_RADIUS _Server\Ne twrix_Audi tor_Add-on _for_RADIU S_Server.p s1 -Radiushost 192.1.1.4
How do I get the script to answer the prompt automatically with R each time?
Example of my script: -file C:\Netwrix_Auditor_Add-on_
Guess you need to set the execution policy, for example
Set-ExecutionPolicy RemoteSigned
ASKER
here is the script
Good catch Sean, I completely missed the text of the error.
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Please repost file
ASKER
here it is posted again
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
David,
In the following argument where do I add -executionpolicy bypass?
-file C:\Netwrix_Auditor_Add-on_ for_RADIUS _Server\Ne twrix_Audi tor_Add-on _for_RADIU S_Server.p s1 -Radiushost 192.161.1.0
In the following argument where do I add -executionpolicy bypass?
-file C:\Netwrix_Auditor_Add-on_
If so you can simply edit the script to produce the value of whatever variable the read-host / prompt populates or simply remove that piece.
Sharing the script would be a great starting point :)
Or just look for a spot where you see something like:
$somvariable = Read-Host "hit R for Run once S for Suspend or ? Help"
then replace with
$somevariable = "R"