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

New-PSDrive : Exception calling "Parse" with "1" argument(s): "String was not recognized as a valid DateTime #464

Closed brwilkinson closed 1 year ago

brwilkinson commented 2 years ago

Steps to reproduce

New-PSDrive -Name vsts -PSProvider SHiPS -Root 'VSTeam#vsteam_lib.Provider.Account' -Description https://dev.azure.com/myproject103

module version 7.3.0 works fine. latest module 7.6.1 has this error.

Tested in Windows Powershell and PowerShell 7,

Expected behavior

I expected that...

drive gets mapped

Name           Used (GB)     Free (GB) Provider      Root                                                                                                                                                                                                                              CurrentLocation
----           ---------     --------- --------      ----                                                                                                                                                                                                                              --------------- 
vsts                                   SHiPS         VSTeam#vsteam_lib.Provider.Account

Actual behavior?

New-PSDrive : Exception calling "Parse" with "1" argument(s): "String was not recognized as a valid DateTime

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

seems to throw an error  :(

 Get-VSTeamAPIVersion
_getApiVersion: C:\Program Files\WindowsPowerShell\Modules\VSTeam\7.6.1\vsteam.functions.ps1:3596
Line |
3596 |           Version                     = $(_getApiVersion Version)
     |                                                          ~~~~~~~
     | Cannot validate argument on parameter 'Service'. The argument "Version" does not belong to the set
     | "Build,Release,Core,Git,DistributedTask,DistributedTaskReleased,VariableGroups,Tfvc,Packaging,MemberEntitlementManagement,ExtensionsManagement,ServiceEndpoints,Graph,TaskGroups,Policy,Processes,HierarchyQuery,Pipelines,Billing,Wiki,WorkItemTracking" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.

Billing                     :
Build                       : 3.0
Core                        : 3.0
DistributedTask             : 3.0-preview
DistributedTaskReleased     :
ExtensionsManagement        : 3.0-preview
Git                         : 3.0
Graph                       :
HierarchyQuery              :
MemberEntitlementManagement :
Packaging                   : 3.0-preview
Pipelines                   :
Policy                      : 3.0
Processes                   :
Release                     : 3.0-preview
ServiceEndpoints            : 3.0-preview
TaskGroups                  : 3.0-preview
Tfvc                        : 3.0
VariableGroups              :
Version                     :
Wiki                        :
WorkItemTracking            : 3.0

Log output of $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.2
PSEdition                      Core
GitCommitId                    7.2.2
OS                             Microsoft Windows 10.0.22587
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
SebastianSchuetze commented 2 years ago

Can you check if the workaround with the env variable in #455 is working for you?

brwilkinson commented 2 years ago

Sure will test this tomorrow:

$env:VSTEAM_NO_MODULE_MESSAGES = $true
brwilkinson commented 2 years ago

@SebastianSchuetze

Confirmed that workaround appears to work ✅

Feel free to close this if it's a duplicate.

SebastianSchuetze commented 2 years ago

Thanks but it's a bug that is supposed to be fixed 😬.

I have to recheck.

SebastianSchuetze commented 1 year ago

@brwilkinson Seems like I just fixed it with #480

jeremytbrun commented 1 year ago

I just ran into this issue and the environment variable workaround worked. Isn't this supposed to be fixed? Running VSTeam Module v7.9.0 in PowerShell 7.3.3.

jeremytbrun commented 1 year ago

@SebastianSchuetze