- Open Notepad.
- Add commands to notepad.
- Save file with a .ps1 extension
- Open your powercli shell
- Connect to your host or vsphere istance using the command
- Once connected run your script by placing .\ in front of the name of the script.
- Your script has run
Here is a walk through on how to make and run a powershell /powercli script
The methods also apply to powershell but this is target towards running powercli commands for your esxi or vsphere hosts.
In this example I named it snapscript.ps1
Connect-viserve r HOSTorVSPHERENAME
Example: I'm connecting to my vsphere via ip
You might have to enter credentials:
Example: .\snapscript.ps1
Any errors will come up in the box with red text ,
0 comments:
Post a Comment