Get-WIs

Introduction

The Get-WIs CmdLet enables to retrieve a set of workitems. With this CmdLet, you can retrieve a set of workitems not only from the server or a project, but also from a specific query, or query directly.

Obtain the TFS server using the Get-TFS CmdLet.

Parameters

Name Description Example
-tfs TFS server obtained using Get-TFS $tfs = Get-TFS -rul http://address:8080
-projectname Project name
-storedquery Workitem query name My Work Items
-query Query to execute Select System.ID from WorkItem

Example where retrieving all workitems

Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. Tous droits réservés.

PSTFS > $tfs = tfs colmar
PSTFS > $wis = get-wis -tfs $tfs
PSTFS > $wis |format-table

         Id Uri            Revision Revisions   Attachments Links       Store       Title       State       Reason
         -- ---            -------- ---------   ----------- -----       -----       -----       -----       ------
          1 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
          2 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
          3 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
          4 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
          5 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
          6 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
     
.....

         51 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         52 vstfs://...           1 {Microso... {}          {}          Microsof... Create V... Active      New
         53 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         54 vstfs://...           1 {Microso... {}          {}          Microsof... Create P... Active      New
         55 vstfs://...           1 {Microso... {}          {}          Microsof... Define I... Active      New
         56 vstfs://...           1 {Microso... {}          {}          Microsof... Create T... Active      New
         57 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         58 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         59 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         60 vstfs://...           1 {Microso... {}          {}          Microsof... Create I... Active      New

Example retrieving all workitems of a project.

Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. Tous droits réservés.

PSTFS > $tfs = tfs colmar

PSTFS > $wis = get-wis -tfs $tfs -projectname test
PSTFS > $wis |format-table

         Id Uri            Revision Revisions   Attachments Links       Store       Title       State       Reason
         -- ---            -------- ---------   ----------- -----       -----       -----       -----       ------
         16 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         17 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         18 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         19 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         20 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         21 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         22 vstfs://...           1 {Microso... {}          {}          Microsof... Create V... Active      New
         23 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         24 vstfs://...           1 {Microso... {}          {}          Microsof... Create P... Active      New
         25 vstfs://...           1 {Microso... {}          {}          Microsof... Define I... Active      New
         26 vstfs://...           1 {Microso... {}          {}          Microsof... Create T... Active      New
         27 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         28 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         29 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         30 vstfs://...           1 {Microso... {}          {}          Microsof... Create I... Active      New


Example with the run of a project query

Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. Tous droits réservés.

PSTFS > $tfs = tfs colmar

PSTFS > $wis = get-wis -tfs $tfs -projectname test -storedquery "My Work item"
Not stored query
Get-WIs : La référence d'objet n'est pas définie à une instance d'un objet.
Au niveau de ligne : 1 Caractère : 15
+ $wis = get-wis  <<<< -tfs $tfs -projectname test -storedquery "My Work item"

PSTFS > $wis = get-wis -tfs $tfs -projectname test -storedquery "My Work Items"
PSTFS > $wis | format-table

         Id Uri            Revision Revisions   Attachments Links       Store       Title       State       Reason
         -- ---            -------- ---------   ----------- -----       -----       -----       -----       ------
         16 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         17 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         18 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         19 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         20 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         21 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         22 vstfs://...           1 {Microso... {}          {}          Microsof... Create V... Active      New
         23 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         24 vstfs://...           1 {Microso... {}          {}          Microsof... Create P... Active      New
         25 vstfs://...           1 {Microso... {}          {}          Microsof... Define I... Active      New
         26 vstfs://...           1 {Microso... {}          {}          Microsof... Create T... Active      New
         27 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         28 vstfs://...           1 {Microso... {}          {}          Microsof... Brainsto... Active      New
         29 vstfs://...           1 {Microso... {}          {}          Microsof... Set up: ... Active      New
         30 vstfs://...           1 {Microso... {}          {}          Microsof... Create I... Active      New

Last edited Nov 7, 2009 at 3:38 PM by pc152, version 4

Comments

No comments yet.