ecitsolutions / Autotask

A PowerShell module for Autotask Web Services API
MIT License
65 stars 18 forks source link

New-AtwsClientPortalUser gives a validation error #127

Open knific opened 1 year ago

knific commented 1 year ago

I am trying to add new client portal user:

New-AtwsClientPortalUser -ContactID 12345678 -UserName "user@foo.bar" "Einfach" -DateFormat "dd.MM.yyyy" -TimeFormat "HH:mm" -NumberFormat "X.XXX,XX" -ClientPortalActive $true`

I get a vaildation error:

WARNING: dd.MM.yyyy is not one of dd.MM.yyyy2
New-AtwsClientPortalUser: Cannot validate argument on parameter 'DateFormat'. The "
      $set = (Get-AtwsPicklistValue -Entity ClientPortalUser -FieldName DateFormat -Label) + (Get-AtwsPicklistValue -Entity ClientPortalUser -FieldName DateFormat -Value)
      if ($_ -in $set) { return $true}
      else {
        Write-Warning ('{0} is not one of {1}' -f $_, ($set -join ', '))
        Return $false
      }
    " validation script for the argument with value "dd.MM.yyyy" did not return a result of True. Determine why the validation script failed, and then try the command again.

The picklist seems fine to me:

PS C:\Windows\System32> Get-AtwsPicklistValue -Entity ClientPortalUser -FieldName DateFormat -Label
dd.MM.yyyy

I have tried Powershell v5 and v7 with the same result.