JustinGrote/JAz.PIM

Prerequisite check

Closed this issue · 1 comments

Even though the following is defined in JAz.PIM.psd1:

# Modules that must be imported into the global environment prior to importing this module
RequiredModules  = @('Az.Resources', 'Microsoft.Graph.DeviceManagement.Enrolment')

There isn`t any errors or warnings loading the module without these pre-requisites, so trying to run a command results in:

Get-JAzRole
Get-JAzRole: The term 'Get-AzRoleEligibilitySchedule' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Maybe a pre-requisites check with a prompt to install the missing modules could be added in order to make it more convenient for the user?
Also, with a minimum version check. On the dev-container I tested I had version 5.1 of Az.Resources, where Get-AzRoleEligibilitySchedule was missing (had to update to 5.6.0).

@janegilring yeah it's more the minimumversion check causing the problem here as these cmdlets are very new and are part of the beta API, I do plan to add that once I get the Azure AD roles working (they do! now just some cleanup!)