Remove-Files

Introduction

The Remove-Files cmdlet enables to PERMANENTLY delete one file or more.

WARNING : Deletion is PERMANENT, there is no way to rollback, files will not be available in the history anymore.

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
-Patch Patch server

Example

This example retrieves the number of file in "$/demoauto/IntR2" folder before and after deletion.

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 > $files = Get-Files -tfs $tfs -Path "$/demoauto/IntR2"
PSTFS > $files.Count
225

PSTFS > Remove-Files -tfs $tfs -Source "$/demoauto/IntR2" -DestroyFlags none
Are you sure to delete the folder or file ?
y

PSTFS > $files = Get-Files -tfs $tfs -Path "$/demoauto/IntR2"
PSTFS > $files.Count
1

PSTFS > $files | foreach {$_.ServerItem}
$/DemoAuto/IntR2

PSTFS >

Last edited Nov 8, 2009 at 10:43 AM by pc152, version 2

Comments

No comments yet.