azure - Newb Powershell 问题创建自适应范围以实现合规性

标签 azure powershell

根据我读过和遵循的一些示例,我认为这会非常简单......但是 Ps 对我大喊大叫。有什么想法这有什么问题吗?我是在 PS 窗口而不是 ISE 中执行此操作。

$name = "SharePoint Teams AS1"
$comment = "PowerShell Adaptive Scope Multiple Advanced Filter"
$locationtype = "Site"

$filterconditions = @{
    "Conditions" = @(

            "Value" = "https://sitename"
            "Operator" = "Equals"
            "Name" = "SPSiteURL"
        },
        @{
            "Value" = "https://sitename"
            "Operator" = "Equals"
            "Name" = "SPSiteURL"
        }
        
    )
 "Conjunction" = "Or"
}
 
New-AdaptiveScope `
    -Name $name `
    -Comment $comment `
    -LocationType $locationtype `
    -FilterConditions $filterconditions

最佳答案

您的情况是缺少一些括号和卷发男孩。

$filterconditions = @{

'Conditions' = @(

@{
   'Value' = 'https://sitename'
   'Operator' = 'Equals'
   'Name' = 'SPSiteURL'
},

@{
   'Value' = 'https://sitename'
   'Operator' = 'Equals'
   'Name' = 'SPSiteURL'
 }
)
    'Conjunction' = 'Or'
}

关于azure - Newb Powershell 问题创建自适应范围以实现合规性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72047709/

相关文章:

powershell - Azure Process Explorer 中的 KuduHandles 是什么?

node.js - npm azure-storage 下载文件为 base64

python - 从训练脚本访问 AML 数据存储上的数据

powershell - 如何实现两行提示?

Azure应用程序服务docker容器 'Service Unavailable'

powershell - 模块未永久加载

azure - Powershell HTTP Post 到服务总线队列返回 401

powershell - HDInsight Hive日志位置

powershell - powershell:基于注释的帮助

azure - 我可以使用哪些 Microsoft Graph 用户属性来获取每个用户的附加信息