Hi Team,

I have power shell command to start and stop the Azure VM’s without logging into the Azure portal.

Here i’m Looking for a Script and want to Schedule it.

Every time i can’t login to Power Shell or Azure Portal to stop or start the VM.

Procedure_to_shutdown_and_start_VM_using_CMD.docx (216 KB)

6 Spice ups

Hi,

What error you are facing?

You say you want to schedule it, does that means that your actual procedure works line per line but not when you create a .ps1 file with multiple commands inside?

If so, then it can be an execution policy issue.

Open a PS console on the computer that executes the scheduled taks, then type

set-executionpolicy unrestricted

Try again, and it will work.

If that’s not the issue, could you please give us the details of the error you are facing?

Azure has functionality for this named “Automation”, now I’m not certain if you’re registered for this, but it handles this just fine according to the documentation.

Now maybe you’re looking to do this without having to pay for the additional feature of “Automation” but I would consider using that.

I don’t have any unrestricted policy. i’m not getting any error. I need a script so i can stop and start the VM with one click.

I have not created any .ps1

Policy.PNG

Why not convert it to workflow then use it within Azure Automation?

1 Spice up

Thanks Team, i tried the Automation and it worked, i’m able to start and stop the VM’s using a Script.

You can close this.