VMware Cloud Community
tdubb123
Expert
Expert

new-deployrule cmdlet missing

I am missing the new-deployrule cmdlet from powrcli.

The term 'new-deployrule' is not recognized as the name 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.

At line:1 char:15

+ new-deployrule <<<<

    + CategoryInfo          : ObjectNotFound: (new-deployrule:String) [], Comm

   andNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

the version of powercli is

PowerCLI Version

----------------

   VMware vSphere PowerCLI 5.1 Release 1 build 793510

---------------

Snapin Versions

---------------

   VMWare AutoDeploy PowerCLI Component 5.1 build 768137

   VMWare ImageBuilder PowerCLI Component 5.1 build 768137

   VMware License PowerCLI Component 5.1 build 669840

   VMware vSphere PowerCLI Component 5.1 build 793489

Also when i open up powercli, I had to manually add the pssnapin vmware.imagebuilder

why is that?

thanks

Reply
0 Kudos
3 Replies
tdubb123
Expert
Expert

oh just found out I needed another snaping

add-pssnapin vmware.deployautomation.

why is this version of cli not loading these snapins ?

Reply
0 Kudos
LucD
Leadership
Leadership

It depends how you started the PowerCLI session.

When you use the shortcuts that are installed, the script Initialize-PowerCLIEnvironment.ps1 will be executed.

In there you will find the Add-PSSnapin cmdlet with all the snapins, including the AutoDeploy one.

If you start the PowerCLI session in another way, you will have to take care yourself to load the snapins.

Add-PSSnapin VMware*

does the trick.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert

Thanks Luc

Reply
0 Kudos