Docker powershell Install-Module partially added module functions of Microsoft graph

Viewed 37

I was trying to build my own custom docker image with azure-powershell docker base image. As an additional feature i need to add Microsoft Graph modules (specially https://www.powershellgallery.com/packages/Microsoft.Graph.Identity.SignIns/1.10.0) in to the docker image. below are some code that i have written to achieve it.

Dockerfile

FROM mcr.microsoft.com/powershell:ubuntu-22.04


RUN     pwsh -Command Set-PSRepository -Name PSGallery -InstallationPolicy Trusted && \
        pwsh -Command Install-Module -Name Microsoft.Graph.Identity.SignIns -Scope AllUsers -Repository PSGallery && \
        pwsh -Command Set-PSRepository -Name PSGallery -InstallationPolicy Untrusted


ADD deployment/powershell/Main.ps1 Main.ps1

CMD ["pwsh", "-File", "Main.ps1"]

Main.ps1

Update-MgPolicyB2CAuthenticationMethodPolicy

Modules path:

ERROR

Line |
  32 |  Update-MgPolicyB2CAuthenticationMethodPolicy
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'Update-MgPolicyB2CAuthenticationMethodPolicy' 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.

Info powershell version: 7.2.5

Find-Module log

Name              : Microsoft.Graph.Identity.SignIns
Path              : /usr/local/share/powershell/Modules/Microsoft.Graph.Identit
                    y.SignIns/1.10.0/Microsoft.Graph.Identity.SignIns.psd1
Description       : Microsoft Graph PowerShell Cmdlets
Guid              : 60f889fa-f873-43ad-b7d3-b7fc1273a44f
Version           : 1.10.0
ModuleBase        : /usr/local/share/powershell/Modules/Microsoft.Graph.Identit
                    y.SignIns/1.10.0
ModuleType        : Script
PrivateData       : {PSData, Profiles}
AccessMode        : ReadWrite
ExportedAliases   : {}
ExportedCmdlets   : {}
ExportedFunctions : {[Confirm-MgInformationProtectionSignature,
                    Confirm-MgInformationProtectionSignature],
                    [Confirm-MgRiskyServicePrincipalCompromised,
                    Confirm-MgRiskyServicePrincipalCompromised],
                    [Confirm-MgRiskyUserCompromised,
                    Confirm-MgRiskyUserCompromised],
                    [Get-MgDataPolicyOperation, Get-MgDataPolicyOperation]…}
ExportedVariables : {}
NestedModules     : {}

Question According to Microsoft.Graph.Identity.SignIns there are many functions present some of the functions worked fine some are not like above. There is no deprecation information given in the docs. What is the main reason for this partial load ?

enter image description here

1 Answers
Related