gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 07:02:51 24 4
gpt4 key购买 nike

根据我读过和遵循的一些示例,我认为这会非常简单......但是 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com