Skip to content

Trimmed Time value breaks Enable-DCEntraIDPIMRoles -useMaximumTimeAllowed argument #50

@mallengoebel

Description

@mallengoebel

Error Message when using -UseMaximumTimeAllowed. Correct formatting broken error.

New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest_Create: The Active duration is too short. Miniumum Required is 5 minutes. Status: 400 (BadRequest) ErrorCode:
ActiveDurationTooShort Date: 2024-09-21T22:53:02 Headers: Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000 request-id :
client-request-id : :
{"ServerInfo":{}} Date : Sat, 21
Sep 2024 22:53:01 GMT
Enable-DCEntraIDPIMRole: C:\Users<string>\Downloads\enable-PIM-roles-Graph 3.ps1:45
Line |
45 | Enable-DCEntraIDPIMRole -RolesToActivate $Roles -Reason $Reason -UseM …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert argument "value", with value: "1230M", for "AddHours" to type "System.Double": "Cannot convert
| value "1230M" to type "System.Double". Error: "The input string '1230M' was not in a correct format.""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions