MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
442 stars 155 forks source link

Get-VSTeamGitCommit not showing correct Date, Author/Committer on a select statement showing vsteam_lib.GitUserDate #513

Closed dinglea closed 1 year ago

dinglea commented 1 year ago

Steps to reproduce


## Get all Repos for Processing
$RepoIDs = (Get-VSTeamGitRepository).id

## Loop for Repos 
foreach ($RepoID in $RepoIDs){

        Get-VSTeamGitCommit -RepositoryID $RepoID | select Date, Author, Comment

}

Expected behavior

I expected that... Date : (Doesn't show) Author : (Correct User) Committer : (Correct User) Comment : (Shows Correctly)

Actual behavior?

I had the following actual outcome... Date : (Doesn't show) Author : vsteam_lib.GitUserDate Committer : vsteam_lib.GitUserDate Comment : (Shows Correctly)

Get-VSTeamGitCommit -RepositoryID $RepoID -FromDate $PriorWeek | FT Date, Committer

Date Committer


 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate
 vsteam_lib.GitUserDate

On Which OS have you tried it?

Windows

What was your server version?

Azure DevOps Services

Other server version

No response

Log output of used API

PS C:\WINDOWS\system32> Get-VSTeamAPIVersion

Billing                     : 5.1-preview.1
Build                       : 5.1
Core                        : 5.1
DistributedTask             : 6.0-preview
DistributedTaskReleased     : 5.1
ExtensionsManagement        : 6.0-preview
Git                         : 5.1
Graph                       : 6.0-preview
HierarchyQuery              : 5.1-preview
MemberEntitlementManagement : 6.0-preview
Packaging                   : 6.0-preview
Pipelines                   : 5.1-preview
Policy                      : 5.1
Processes                   : 6.0-preview
Release                     : 5.1
ServiceEndpoints            : 5.0-preview
TaskGroups                  : 6.0-preview
Tfvc                        : 5.1
VariableGroups              : 5.1-preview.1
Version                     : VSTS
Wiki                        : 6.0
WorkItemTracking            : 6.0-preview.1

Log output of $PSVersionTable

PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value                                                                                                                                                             
----                           -----                                                                                                                                                             
PSVersion                      5.1.19041.2364                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                           
BuildVersion                   10.0.19041.2364                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                               
SerializationVersion           1.1.0.1
dinglea commented 1 year ago

So work around for this i can do the following in the select statement and it returns the data correctly

Get-VSTeamGitCommit -RepositoryID $RepoID.id -Verbose -FromDate $PriorWeek | Select {$.Committer.Date}, {$.Committer.Name}, Name, CommitID