looking to leverage this automation, but keep running into a situation where running:
Remove-LapsedAMI -ProfileName tst2 -Region us-east-2 -BackupSuffix '' -DailyBackupRetentionPeriod 30 -RunAsTestOnly:$false
all it does it displays what it would of removed, doesn't actually issue the commands inside:
# SETUP SPLATTER TABLE FOR PARAMETERS
$Splat.Remove('Owner'); $Splat['bolRunAsTestOnly'] = $RunAsTestOnly
# UNREGISTER AMIS
if ( $DailyImagesToDelete ) { Unregister-EC2AmisandSnapshot @Splat -amisTargetedForDeletion $DailyImagesToDelete }
if ( $WeeklyImagesToDelete ) { Unregister-EC2AmisandSnapshot @Splat -amisTargetedForDeletion $WeeklyImagesToDelete }
if ( $MonthlyImagesToDelete ) { Unregister-EC2AmisandSnapshot @Splat -amisTargetedForDeletion $MonthlyImagesToDelete }