mrochon / b2csamples

MIT License
132 stars 41 forks source link

Setup-B2CMultiTenant The term xxx is not recognized error #20

Closed zlannin closed 3 years ago

zlannin commented 3 years ago

When I run the Setup-B2CMultiTenant.ps1 script I receive many errors along the lines of the following. I've also installed all the required modules from https://github.com/mrochon/b2csamples/tree/master/Scripts/MultiTenant#install-required-powershell-modules. It seems like I'm missing another module, or a module needs imported?

Connect-AzureAD: /Users/zach/Desktop/MultiTenantTemp/Setup-B2CMultiTenant.ps1:115
Line |
 115 |  Connect-AzureAD -TenantId $settings.b2cTenant -AccountId $azure.Accou …
     |  ~~~~~~~~~~~~~~~
     | The term 'Connect-AzureAD' 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.

Get-AzureADCurrentSessionInfo: /Users/zach/Desktop/MultiTenantTemp/Setup-B2CMultiTenant.ps1:116
Line |
 116 |  $b2c = Get-AzureADCurrentSessionInfo -ErrorAction stop
     |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'Get-AzureADCurrentSessionInfo' 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.

...
PS /Users/zach/Desktop/MultiTenantTemp> Get-Module                                                                                                                                                                                      ModuleType Version    PreRelease Name                                ExportedCommands                               ---------- -------    ---------- ----                                ----------------                               
Script     2.4.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzContext, Clear-Az…
Script     4.2.0                 Az.Resources                        {Add-AzADGroupMember, Export-AzResourceGroup,…
Script     2.7.0                 Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWeb…
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clea…
Manifest   7.0.0.0               Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureSt…
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compar…
Script     1.4.7                 PackageManagement                   {Find-Package, Find-PackageProvider, Get-Pack…
Script     2.2.5                 PowerShellGet                       {Find-Command, Find-DscResource, Find-Module,…
Script     2.1.0                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOpti…

Any help would be greatly appreciated!

mrochon commented 3 years ago

You are missing the AzureAD PowerShell module.