Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180923

what needs to go at top of script file to work?

$
0
0

I have installed VMware Powercli onto my Windows 2008 R2 server that is also my vCenter.  If I lunch the PowerCLI and do the following, all commands work:

 

connect-viserver -server localhost -user administrator

set-vm -vm Server01 -snapshot Gold

set-vm -vm-Server02 -snaphot Gold

etc,

etc

etc

 

 

If I create a file names, C\scripts\revertGold.ps1 and include the following, is does not work but gives errors

set-vm -vm Server01 -snapshot Gold

set-vm -vm-Server02 -snaphot Gold

etc,

etc

etc

 

I try to execute this script from within Powershell with the following errors:

 

The term 'set-vm' is not recognizes as the anme of a cmdlet, function, script file, or operable program.  Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

 

 

I know that this is basic, but this is my first script within powercli/powershell.  Can you point me to what I am missing to make this script work and run all cmdlets within?

 

Thank you

 

Rick


Viewing all articles
Browse latest Browse all 180923

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>