VMware Cloud Community
jedijeff
Enthusiast
Enthusiast
Jump to solution

Question on using Get-View vs Get-VM, etc

I did some monitor powercli maybe 3 years ago, just some 1-liners and very small scripts. I am starting again and would like to really dedicate some time to it. In looking at sample scripts to get my mind refreshed, I see some people using Get-view, some people using get-vm, etc. for nearly the same task. I read get-view should be much fast. Since I am kind of picking this up again, should I focus on learning get-view?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Not immediately.

The Get-View cmdlet is indeed faster in larger vSphere environments.

And with Get-View you can also get access to vSphere API methods and properties that are not yet exposed through PowerCLI cmdlets.

Some suggestions I always give:

  • Set yourself some practical goals. That is more productive then reading and learning cmdlets one by one. For example, try to produce a report to document your vSphere environment. Later, add functionality, for example a function to compare two such reports and list the changes.
  • Don't forget to improve your PowerShell knowledge. PowerCLI is built on top of PowerShell, knowing the basics will make scripting a lot easier and will allow you to write more efficient code
  • Start with the PowerCLI cmdlets, and see how far they can bring you
    • First the Get- cmdlets, they can do no harm, you are only reading from the vSphere environment
    • Later the Set- and New- cmdlets, these allow you to modify and create objects and settings in the vSphere environment
  • Start digging into the API. For example, add some values to your report that are not readily available through PowerCLI cmdlets

Christophe made a great document on a sample learning track for PowerCLI.

See his PowerCLI study guide – core concepts


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Not immediately.

The Get-View cmdlet is indeed faster in larger vSphere environments.

And with Get-View you can also get access to vSphere API methods and properties that are not yet exposed through PowerCLI cmdlets.

Some suggestions I always give:

  • Set yourself some practical goals. That is more productive then reading and learning cmdlets one by one. For example, try to produce a report to document your vSphere environment. Later, add functionality, for example a function to compare two such reports and list the changes.
  • Don't forget to improve your PowerShell knowledge. PowerCLI is built on top of PowerShell, knowing the basics will make scripting a lot easier and will allow you to write more efficient code
  • Start with the PowerCLI cmdlets, and see how far they can bring you
    • First the Get- cmdlets, they can do no harm, you are only reading from the vSphere environment
    • Later the Set- and New- cmdlets, these allow you to modify and create objects and settings in the vSphere environment
  • Start digging into the API. For example, add some values to your report that are not readily available through PowerCLI cmdlets

Christophe made a great document on a sample learning track for PowerCLI.

See his PowerCLI study guide – core concepts


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

Reply
0 Kudos
jedijeff
Enthusiast
Enthusiast
Jump to solution

Thank you so much. I will look at that guide too. And I actually am going through just Powershell courses on lynda.com as well.

Reply
0 Kudos