invoke-wiq.ps1 - "run" a .wiq file and get the results back

This request came in from an internal PS list.  You can certainly make it fancier, and all it does now is invoke a WIT method, but hopefully you may find it of value.

 

 param($wiqfilename = $(throw 'must specify wiq filename'))

# get the fullpath to the psqfile, get the provider path as
# it will handle UNC paths too
$wiqfilename = (Resolve-Path $wiqfilename).ProviderPath
$wiq = [xml] (gc $wiqfilename)

$tfs = get-tfs $wiq.WorkItemQuery.TeamFoundationServer
$results = $tfs.wit.Query($wiq.WorkItemQuery.Wiql, @{'project' = $wiq.WorkItemQuery.TeamProject})
$results