Get-Diff

Introduction

Le cdmlet Get-Diff permet de voir la différence entre deux répertoires du serveur.
Cette commande a été développée dans le but de comparer deux branches.

La récupération d'un serveur TFS ce fait grâce au CmdLet Get-TFS.

Paramètres

Nom Description Exemple
-TFS Serveur TFS récupérer avec Get-TFS $tfs = Get-TFS -url http://colmar:8080
-PathL Element source
-PathR Element desctination
-Information Permet d'indiquer si il y a récupération de toutes les informations

Exemple de récupération des différences


PSTFS > $tfs = Get-TFS colmar
PSTFS > $diff = Get-Diff -tfs $tfs -PathR "$/VSTS.Noham/PsTFS" -PathL "$/VSTS.Noham/PsTFS_Prod" -Information $true

PSTFS > $diff | ft

Time           Folder         NameL          NameR                   TDiff StreamL        StreamR        ResultDiff
----           ------         -----          -----                   ----- -------        -------        ----------
Results: 0,... /PsTFS/        AssemblyInf... AssemblyInf...      Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        MyHost.cs      MyHost.cs                Diff {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        MyHostUserI... MyHostUserI...           Diff {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        MyRawUserIn... MyRawUserIn...      Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        PsTFS.cs       PsTFS.cs                 Diff {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        PsTFS.csproj   PsTFS.csproj             Diff {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        PsTFS.cspro... PsTFS.cspro...      Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        PsTFS.sln      PsTFS.sln           Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS/        PsTFS.vssscc   PsTFS.vssscc        Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS.CmdLet/ Get-TFS.cs     Get-TFS.cs               Diff {PowerShell... {PowerShell... {AddDestina...
Results: 0,... /PsTFS.CmdLet/ PsTFS.CmdLe... PsTFS.CmdLe...           Diff {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS.CmdLet/ PsTFS.CmdLe... PsTFS.CmdLe...      Identical {PowerShell... {PowerShell... {NoChange (...
Results: 0,... /PsTFS.CmdL... AssemblyInf... AssemblyInf...      Identical {PowerShell... {PowerShell... {NoChange (...
               /PsTFS.CmdLet/ Add-Branch.cs                          Right
               /PsTFS.CmdLet/ Add-Files.cs                           Right
               /PsTFS.CmdLet/ Add-Label.cs                           Right
               /PsTFS.CmdLet/ Add-MemberP...                         Right
               /PsTFS.CmdLet/ Add-Project.cs                         Right
               /PsTFS.CmdLet/ Add-WI.cs                              Right
               /PsTFS.CmdLet/ Get-AllProj...                         Right
               /PsTFS.CmdLet/ Get-Changes...                         Right
               /PsTFS.CmdLet/ Get-Diff.cs                            Right
               /PsTFS.CmdLet/ Get-IGroupS...                         Right
               /PsTFS.CmdLet/ Get-LogTSF.cs                          Right
               /PsTFS.CmdLet/ Get-Pending...                         Right
               /PsTFS.CmdLet/ Get-Project...                         Right
               /PsTFS.CmdLet/ Get-Version...                         Right
               /PsTFS.CmdLet/ Get-WI.cs                              Right
               /PsTFS.CmdLet/ Get-WIQueri...                         Right
               /PsTFS.CmdLet/ Get-WIs.cs                             Right
               /PsTFS.CmdLet/ Get-WorkIte...                         Right
               /PsTFS.CmdLet/ PowerShell....                         Right
               /PsTFS.CmdLet/ PsTFS.snk                              Right
               /PsTFS.CmdLet/ Remove-File...                         Right
               /PsTFS.CmdLet/ Remove-Proj...                         Right
               /PsTFS.CmdLet/ Set-Export.cs                          Right
               /PsTFS.CmdLet/ Set-Merge.cs                           Right
               /PsTFS.CmdL... BlocNote.txt                           Right
               /PsTFS.CmdL... MoveFile.txt                           Right
               /PsTFS.CmdL... NewProject.xml                         Right
               /PsTFS.CmdL... Set-Merge.txt                          Right
               /PsTFS.CmdL... PsDiff.cs                              Right
               /PsTFS.CmdL... PsEnum.cs                              Right
               /PsTFS.CmdL... PsFilePendi...                         Right
               /PsTFS.CmdL... PsFilesDiff.cs                         Right
               /PsTFS.CmdL... PsGroups.cs                            Right
               /PsTFS.CmdL... PsLog.cs                               Right
               /PsTFS.CmdL... PsMember.cs                            Right
               /PsTFS.CmdL... PsMethode.cs                           Right
               /PsTFS.CmdL... PsPendingSt...                         Right
               /PsTFS.CmdL... PsService.cs                           Right
               /PsTFS.CmdL... PsWorkitem.cs                          Right

Exemple de l'affichage des modifications du fichier destination


PSTFS > $diff[9].StreamR | ft

Number                                  Line                                                       DiffResultSpanStatus
------                                  ----                                                       --------------------
00001                                   /*                                                               AddDestination
00002                                    * PsTFS is a set of PowerShell comm...                          AddDestination
00003                                    * effectiveness is combined with th...                          AddDestination
00004                                    *                                                               AddDestination
00005                                    * Creator : Choulant Noham                                      AddDestination
00006                                    * Mail : choulant@gmail.com                                     AddDestination
00007                                    * Blog : http://choulant.blogspot.com                           AddDestination
00008                                    *                                                               AddDestination
00009                                    */                                                              AddDestination
00010                                   using System;                                                          NoChange
00011                                   using System.ComponentModel;                                           NoChange
00012                                   using System.Management.Automation;                                    NoChange
00013                                   using System.Collections.Generic;                                      NoChange
00014                                   using System.Diagnostics;                                              NoChange
00015                                   using System.Text;                                                     NoChange
00016                                   using System.Configuration.Install;                                    NoChange
00017                                   using Microsoft.TeamFoundation.Client;                                 NoChange
00018                                   using PowerShell.Host.PsTFS.CdmLet.P...                          AddDestination
00019                                                                                                    AddDestination
00020                                   //Intallation : C:\WINDOWS\Microsoft...                                NoChange
00021                                   //add-pssnapin ServerTFSPSSnapIn                                        Replace
00022                                   //                                                                     NoChange
00023                                                                                                          NoChange
00024                                                                                                          NoChange
00025                                   namespace PowerShell.Host.PsTFS.CdmLet                                 NoChange
00026                                   {                                                                      NoChange
00027                                       /// <summary>                                                AddDestination
00028                                       /// Récupère un serveur TFS                                  AddDestination
00029                                       /// </summary>                                               AddDestination
00030                                       [Cmdlet(VerbsCommon.Get, "TFS")]                                   NoChange
00031                                       public class ServerTFS : Cmdlet                                    NoChange
00032                                       {                                                                  NoChange
00033                                           protected override void Proc...                                NoChange
00034                                           {                                                              NoChange
00035                                               try                                                        NoChange
00036                                               {                                                          NoChange
00037                                                   TeamFoundationServer...                                 Replace
00038                                                                                                    AddDestination
00039                                                   if (Login != null &&...                          AddDestination
00040                                                   {                                                AddDestination
00041                                                       System.Net.Netwo...                          AddDestination
00042                                                       tfs = new TeamFo...                          AddDestination
00043                                                   }                                                AddDestination
00044                                                   else                                             AddDestination
00045                                                   {                                                AddDestination
00046                                                       tfs = TeamFounda...                          AddDestination
00047                                                   }                                                AddDestination
00048                                                                                                          NoChange
00049                                                   //Retourne l'assembl...                                NoChange
00050                                                   WriteObject(tfs);                                      NoChange
00051                                               }                                                          NoChange
00052                                               catch (Exception ex)                                       NoChange
00053                                               {                                                          NoChange
00054                                                   ErrorRecord err = ne...                                NoChange
00055                                                   WriteError(err);                                       NoChange
00056                                                   PsLog.AddLog(null, e...                          AddDestination
00057                                               }                                                          NoChange
00058                                                                                                          NoChange
00059                                           }                                                              NoChange
00060                                                                                                          NoChange
00061                                           /// <summary>                                                   Replace
00062                                           /// Permet d'informer la fin...                                 Replace
00063                                           /// </summary>                                                  Replace
00064                                           protected override void EndP...                                 Replace
00065                                           {                                                              NoChange
00066                                               PsLog.AddLog(null, "Get-...                                 Replace
00067                                               base.EndProcessing();                                       Replace
00068                                                                                                      DeleteSource
00069                                                                                                      DeleteSource
00070                                                                                                      DeleteSource
00071                                                                                                      DeleteSource
00072                                                                                                      DeleteSource
00073                                                                                                      DeleteSource
00074                                                                                                      DeleteSource
00075                                                                                                      DeleteSource
00076                                           }                                                              NoChange
00077                                                                                                          NoChange
00078                                                                                                           Replace
00079                                           [Parameter(Position = 0, Man...                          AddDestination
00080                                           [ValidateNotNullOrEmpty]                                 AddDestination
00081                                           public String url { get; set; }                          AddDestination
00082                                                                                                    AddDestination
00083                                                                                                    AddDestination
00084                                           [Parameter(Position = 1)]                                AddDestination
00085                                           [ValidateNotNullOrEmpty]                                 AddDestination
00086                                           public String Login { get; s...                          AddDestination
00087                                                                                                    AddDestination
00088                                                                                                    AddDestination
00089                                           [Parameter(Position = 2)]                                      NoChange
00090                                           [ValidateNotNullOrEmpty]                                       NoChange
00091                                           public String Password { get...                                 Replace
00092                                                                                                      DeleteSource
00093                                                                                                      DeleteSource
00094                                                                                                      DeleteSource
00095                                                                                                      DeleteSource
00096                                       }                                                                  NoChange
00097                                                                                                          NoChange
00098                                       /// <summary>                                                AddDestination
00099                                       /// Permet l'installation des Cm...                          AddDestination
00100                                       /// </summary>                                               AddDestination
00101                                       [RunInstaller(true)]                                               NoChange
00102                                       public class ServerTFSPSSnapIn :...                                NoChange
00103                                       {                                                                  NoChange
00104                                           public ServerTFSPSSnapIn()                                     NoChange
00105                                               : base()                                                   NoChange
00106                                           {                                                              NoChange
00107                                           }                                                              NoChange
00108                                                                                                    AddDestination
00109                                           /// <summary>                                            AddDestination
00110                                           /// Nom des cmdlet                                       AddDestination
00111                                           /// </summary>                                           AddDestination
00112                                           public override String Name                                    NoChange
00113                                           {                                                              NoChange
00114                                               get                                                        NoChange
00115                                               {                                                          NoChange
00116                                                   return "ServerTFSPSS...                                NoChange
00117                                               }                                                          NoChange
00118                                           }                                                              NoChange
00119                                           /// <summary>                                            AddDestination
00120                                           ///                                                      AddDestination
00121                                           /// </summary>                                           AddDestination
00122                                           public override String Vendor                                  NoChange
00123                                           {                                                              NoChange
00124                                               get                                                        NoChange
00125                                               {                                                          NoChange
00126                                                   return "choulant.blo...                                NoChange
00127                                               }                                                          NoChange
00128                                                                                                          NoChange
00129                                           }                                                              NoChange
00130                                           public override String Vendo...                                NoChange
00131                                           {                                                              NoChange
00132                                               get                                                        NoChange
00133                                               {                                                          NoChange
00134                                                   return "ServerTFSPSS...                                NoChange
00135                                               }                                                          NoChange
00136                                                                                                          NoChange
00137                                           }                                                              NoChange
00138                                                                                                    AddDestination
00139                                           /// <summary>                                            AddDestination
00140                                           /// Description des cmdlet                               AddDestination
00141                                           /// </summary>                                           AddDestination
00142                                           public override String Descr...                                NoChange
00143                                           {                                                              NoChange
00144                                               get                                                        NoChange
00145                                               {                                                          NoChange
00146                                                   return "Create TFS o...                                NoChange
00147                                               }                                                          NoChange
00148                                                                                                          NoChange
00149                                           }                                                              NoChange
00150                                           public override string Descr...                                NoChange
00151                                           {                                                              NoChange
00152                                               get                                                        NoChange
00153                                               {                                                          NoChange
00154                                                   return "Create TFS o...                                NoChange
00155                                               }                                                          NoChange
00156                                           }                                                              NoChange
00157                                                                                                          NoChange
00158                                       }                                                                  NoChange
00159                                   }                                                                      NoChange


PSTFS >

Last edited Mar 9, 2009 at 7:36 AM by pc152, version 1

Comments

No comments yet.