Functions/Snapshots.psm1

function Remove-Snap {
    <#
        .SYNOPSIS
            Remove vmware snapshots with confirmation screen
        .EXAMPLE
            rmsnap *b2b*
    #>


    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true, ValueFromPipeline = $true)]
        [ValidateNotNullOrEmpty()]
        [string]$VM
    )
    
    Get-VM $VM | Get-Snapshot | %{($_|select VM,Name,Created,SizeGB|fl); Remove-Snapshot -RunAsync $_}

}

function Get-Snap {
    <#
        .SYNOPSIS
            Show vmware snapshots
        .EXAMPLE
            getsnap
    #>

    
    Get-Snapshot -vm * | select vm,created,name,description | Sort-Object Created

}