Posted On December 22, 2021

PowerShell: Quick Snippet to Remove Virtual Machine Snapshots in VMM

kimconnect 0 comments
blog.KimConnect.com >> Codes , Virtualization >> PowerShell: Quick Snippet to Remove Virtual Machine Snapshots in VMM
$vmNames=@(
    'MACHINE1',
    'MACHINE2'
)
foreach($vmName in $vmNames){
    $checkpoint = Get-SCVMCheckpoint -VM $vmName
    if($checkpoint){$checkpoint|%{Remove-SCVMCheckpoint -VMCheckpoint $_ -Confirm:$false}}else{write-host "$vmName is skipped."}
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Windows 10: Update Script

8/7/2020: there's an updated version of this script here. function updateWindows{# Set PowerShell Gallery as…

PowerShell: Activate Remote Windows

$remoteWindows="SHERVER01","SHERVER02"$licenseKey="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"function activateWindows{ param( [string]$key ) $licensingService = get-wmiObject -query "select * from SoftwareLicensingService" -computername $env:computername;…

PowerShell: How to Send Key Strokes to a Program Graphical User Interface

# WARNING: there's a kill-process command when the target program is already running # so…