首页 > 解决方案 > Pester & AzureAdPreview 模块

问题描述

当我通过Invoke-Pester.

错误是The term 'Get-AzureADObjectSetting' is not recognized as the name of a cmdlet, function, script file。此 cmdlet 是通过 module 提供的AzureAdPreview

当我运行相同的测试文件时,Invoke-Pester -Script ./GroupFoobar.tests.ps1是否不会引发此错误。

在某些情况下加载不同的 Pester 模块 - 我使用的是 Pester 4.0.4 版?

标签: powershellpester

解决方案


好的,使用-Force开关AzureAdPreview解决了我的问题:

Import-Module Pester Import-Module AzureAdPreview -Force Import-Module Microsoft.Xrm.Data.Powershell ...


推荐阅读