VMware Cloud Community
Morrisv
Contributor
Contributor

PowerCLI to rename a snapshot

Hi Guys,

I have a task to query an infrastructure (around 50 folders)  for specific snapshot name and rename it.

Let's start with a specific folder:

Folder name = CI133

Snapshot = InfraNew

Renamed Snapshot = InfraOld

Is it a hard script?

Morris

1 Reply
RvdNieuwendijk
Leadership
Leadership

It is not a hard script. You can change the snapshot name in a PowerCLI one-liner:


Get-Folder -Name CI133 | Get-VM | Get-Snapshot -Name InfraNew | Set-Snapshot -Name InfraOld

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition