PowerCLI

 View Only
  • 1.  Create Multiple VM snapshots with VMware PowerCLI 10

    Posted Jul 10, 2018 08:50 AM

    Hello,

    In the earlier version of PowerCLI 6.5 creating a snapshot on multiple VMs was very straightforward.

    Example:

    1) Group VMs: $VM1 = Get-VM VM1, VM2, VM3, VM4

    2) Create snapshots on group VMs: New-Snapshot -VM $VM1 -Name "Your snapshot name" -Description "Your description".

    Since from VMware PowerCLI version 10 'VM" parameter no longer accepts an array, this is no longer possible.

    Can someone write me an example that can be used with PowerCLI 10?



  • 2.  RE: Create Multiple VM snapshots with VMware PowerCLI 10
    Best Answer

    Posted Jul 10, 2018 09:06 AM

    Use the pipeline

    Get-VM VM1, VM2, VM3, VM4 |

    New-Snapshot -Name "Your snapshot name" -Description "Your description".



  • 3.  RE: Create Multiple VM snapshots with VMware PowerCLI 10

    Posted Jul 10, 2018 09:24 AM

    Thank you LucD for your fast and accurate answer. :smileyhappy:



  • 4.  RE: Create Multiple VM snapshots with VMware PowerCLI 10

    Posted Jul 30, 2021 07:23 PM

    # https://virtualizationnation.com/2017/02/06/snapshot-removal-powercli/

    $Authorization = Get-Credential -Message "Virtual Center Login, use your AD Admin account."

    Connect-VIServer -Server abcvcenter.com -AllLinked -Credential $Authorization

    # $vmlist = Get-Content C:\Servers.txt

    #New-Snapshot -VM $vmlist -Name NameOfSnsphot -Description DescriptionOfSnapshot.

    New-Snapshot -VM $vmlist -Name NameOfSnsphot -Description DescriptionOfSnapshot.

    New-Snapshot -VM servername -Name "Server Snapshot" -Description "Server Snaphot"


    # $vmlist = Get-Content C:\Servers.txt
    # Get-VM $vmlist | Get-Snapshot | Remove-Snapshot -Confirm:$false

     

    To remove the snapshots
    Get-VM servername | Get-Snapshot | Remove-Snapshot -Confirm:$false -RemoveChildren

     



  • 5.  RE: Create Multiple VM snapshots with VMware PowerCLI 10

    Posted Jul 30, 2021 07:41 PM

    Did you actually read the question?
    Your solution (?) is in fact the problem



  • 6.  RE: Create Multiple VM snapshots with VMware PowerCLI 10

    Posted Sep 02, 2021 05:52 PM

    Did you ever reach a solution to this?