$ItemList=Get-AzureService|Where-Object{$PSItem.ServiceName-match${wordToComplete}}|ForEach-Object{$CompletionResult=@{CompletionText=$PSItem.ServiceNameToolTip='Cloud Service in "{0}" region.'-f$PSItem.ExtendedProperties.ResourceLocationListItemText='{0} ({1})'-f$PSItem.ServiceName,$PSItem.ExtendedProperties.ResourceLocationCompletionResultType=[System.Management.Automation.CompletionResultType]::ParameterValue}New-CompletionResult@CompletionResult}Set-CompletionPrivateData-Key$CacheKey-Value$ItemList

### If there is a valid cache for the Azure virtual machine names, then go ahead and return them immediatelyif($VirtualMachineNameCache-and(Get-Date)-gt$VirtualMachineNameCache.ExpirationTime){return$VirtualMachineNameCache}