Skip to content

Conversation

nshores
Copy link

@nshores nshores commented Apr 23, 2018

I've created a new function that will check for all VM snapshots, hidden or not, and report on them. Take a look at and let me know if any changes are needed. I tried to follow the existing standards code wise in the rest of the functions.

Copy link
Owner

@Dapacruz Dapacruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix these minor issues.

**Get-VMCpuReadyPercent**
Calculates the CPU ready percent average of virtual machines provided

**Get-VMCpuReadyPercent**
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated from line 43 and 44.

**Get-VMCpuReadyPercent**
Calculates the CPU ready percent average of virtual machines provided

**Get-AllVMsnapshot**
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the function to Get-SnapshotAll. This helps with sorting, the included command is Get-Snapshot.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking Get-SnapshotHidden might be better.

$snapshotfinal = @()
$vmlist = get-vm $VM

#Get a list of all VM's with known snapshots
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should have a space after #.

}
}

#Get all VM's with delta disks
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix function indentation.

$icount = $final.count - $snapshotfinal.count
Write-Output "Total number of VM's with visible snapshots: $vcount"
write-output "Total number of VM's invisible snapshots: $icount"
write-output "`nYou have hidden snapshots on the follow VM's:`n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only print if a hidden snapshot is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants