This project is read-only.

Get-Files

Introduction

The Get-Files cmdlet enables to retrieve files from a server folder.

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
-Path Server folder path "$/DemoAuto/Dev
-RecursionType Tells wether we want to retrieve all files or not Full, None, OneLevel
-Target Target for download a file c:\temp\PsTFS


Example retrieving all files (RecursionType = Full)

Windows PowerShell V2 (Community Technology Preview - Features Subject to Change)
Copyright (C) 2008 Microsoft Corporation. All rights reserved.

Utilisateur courant : Administrateur


PSTFS > $tfs = Get-TFS colmar
PSTFS > $FullFiles = Get-Files -tfs $tfs -Path "$/demoauto"
PSTFS > $FullFiles | ft

ArtifactUri ArtifactUri VersionCont IsContentDe ChangesetId CheckinDate  DeletionId    Encoding    ItemType      ItemId
            LatestItemV rolServer       stroyed
            ersion
----------- ----------- ----------- ----------- ----------- -----------  ----------    --------    --------      ------
vstfs://... vstfs://... Microsof...       False          64 10/01/20...           0          -3      Folder        3054
vstfs://... vstfs://... Microsof...       False          65 10/01/20...           0          -3      Folder        3237
vstfs://... vstfs://... Microsof...       False         130 16/02/20...           0          -3      Folder        5320
vstfs://... vstfs://... Microsof...       False         131 16/02/20...           0          -3      Folder        5545
vstfs://... vstfs://... Microsof...       False          66 10/01/20...           0          -3      Folder        3462
vstfs://... vstfs://... Microsof...       False         115 29/01/20...           0          -3      Folder        4309
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0          -3      Folder        3239
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0          -3      Folder        3238
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0       65001        File        3055
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0       65001        File        3056
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0          -3      Folder        3240
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0        1252        File        3057
vstfs://... vstfs://... Microsof...       False         119 29/01/20...           0          -3      Folder        3271
vstfs://... vstfs://... Microsof...       False         120 30/01/20...           0        1200        File        3058

PSTFS > $FullFiles | foreach {$_.ServerItem} | ft

$/DemoAuto
$/DemoAuto/Dev
$/DemoAuto/Int
$/DemoAuto/IntR2
$/DemoAuto/Main
$/DemoAuto/Release
$/DemoAuto/Dev/PsTFS
$/DemoAuto/Dev/PsTFS/obj
$/DemoAuto/Dev/PsTFS/PsTFS
$/DemoAuto/Dev/PsTFS/PsTFS.CmdLet
$/DemoAuto/Dev/PsTFS/PsTFS.cs
$/DemoAuto/Dev/PsTFS/PsTFS.csproj
$/DemoAuto/Dev/PsTFS/PsTFS.csproj.vspscc
$/DemoAuto/Dev/PsTFS/PsTFS.vssscc
$/DemoAuto/Dev/PsTFS/bin/Debug/PsTFS.exe
$/DemoAuto/Dev/PsTFS/bin/Debug/PsTFS.pdb
$/DemoAuto/Dev/PsTFS/bin/Debug/PsTFS.vshost.exe
$/DemoAuto/Dev/PsTFS/bin/Debug/System.Configuration.Install.dll
$/DemoAuto/Dev/PsTFS/bin/Debug/System.Management.Automation.dll
$/DemoAuto/Dev/PsTFS/bin/Release/Microsoft.TeamFoundation.Client.dll
$/DemoAuto/Dev/PsTFS/bin/Release/Microsoft.TeamFoundation.Common.dll
$/DemoAuto/Dev/PsTFS/bin/Release/Microsoft.TeamFoundation.dll
$/DemoAuto/Dev/PsTFS/bin/Release/Microsoft.TeamFoundation.VersionControl.Client.dll

Example retrieving the root (RecursionType = None)

PSTFS > $BaseFiles = Get-Files -tfs $tfs -Path "$/demoauto" -RecursionType none
PSTFS > $BaseFiles | ft

ArtifactUri ArtifactUri VersionCont IsContentDe ChangesetId CheckinDate  DeletionId    Encoding    ItemType      ItemId
            LatestItemV rolServer       stroyed
            ersion
----------- ----------- ----------- ----------- ----------- -----------  ----------    --------    --------      ------
vstfs://... vstfs://... Microsof...       False          64 10/01/20...           0          -3      Folder        3054


PSTFS > $BaseFiles | foreach {$_.ServerItem} | ft
$/DemoAuto

Example retrieving root first level (RecursionType = OneLevel)


PSTFS > $OneLevelFiles = Get-Files -tfs $tfs -Path "$/demoauto" -RecursionType OneLevel
PSTFS > $OneLevelFiles | ft

ArtifactUri ArtifactUri VersionCont IsContentDe ChangesetId CheckinDate  DeletionId    Encoding    ItemType      ItemId
            LatestItemV rolServer       stroyed
            ersion
----------- ----------- ----------- ----------- ----------- -----------  ----------    --------    --------      ------
vstfs://... vstfs://... Microsof...       False          64 10/01/20...           0          -3      Folder        3054
vstfs://... vstfs://... Microsof...       False          65 10/01/20...           0          -3      Folder        3237
vstfs://... vstfs://... Microsof...       False         130 16/02/20...           0          -3      Folder        5320
vstfs://... vstfs://... Microsof...       False         131 16/02/20...           0          -3      Folder        5545
vstfs://... vstfs://... Microsof...       False          66 10/01/20...           0          -3      Folder        3462
vstfs://... vstfs://... Microsof...       False         115 29/01/20...           0          -3      Folder        4309


PSTFS > $OneLevelFiles | foreach {$_.ServerItem} | ft
$/DemoAuto
$/DemoAuto/Dev
$/DemoAuto/Int
$/DemoAuto/IntR2
$/DemoAuto/Main
$/DemoAuto/Release

Example retrieving files count (RecursionType = Full)

PSTFS > $FullFiles.Count
1126
PSTFS >

Last edited Nov 8, 2009 at 8:30 AM by pc152, version 3

Comments

No comments yet.