From c88c2a2a004fa80db81d632c87b6f5a37a83f1ca Mon Sep 17 00:00:00 2001 From: Chris Harding Date: Fri, 5 Jul 2013 15:35:39 +0100 Subject: [PATCH] Force the filter to return an array at all times to ensure the look-up using index works properly Signed-off-by: Chris Harding --- powershell/samples/AutomatedTestCore.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powershell/samples/AutomatedTestCore.ps1 b/powershell/samples/AutomatedTestCore.ps1 index 914101a..34bb6d6 100644 --- a/powershell/samples/AutomatedTestCore.ps1 +++ b/powershell/samples/AutomatedTestCore.ps1 @@ -248,7 +248,7 @@ function install_vm([String]$name, [String]$sr_name) #find a windows template log_info "looking for a Windows template..." - $template = (Get-XenVM -Name 'Windows XP*' | where {$_.is_a_template})[0] + $template = @(Get-XenVM -Name 'Windows XP*' | where {$_.is_a_template})[0] log_info ("installing vm '{0}' from template '{1}'" -f $template.name_label,$name)