I can't seem to get this 'if then' statement to work. What am I doing wrong with this simple statement.
$checkUS = "false"
$usRegions =(Get-EC2Region) |Where -Property RegionName -Like -Value "us-*" |select RegionName | foreach {$_.RegionName}
$allregions=(Get-EC2Region).RegionName
If($checkUS = "true") {$Regions=$usRegions} Else {$Regions=$allregions}
thanks!