Property "displayName" cannot be found.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- cli
调研方向
打开 scripts/teams-list-teams-owners-and-members,检查 issue 中报告的 Owner、Member 和 Guest 名称管道。将它们与建议的替换方案进行比较,然后验证每个角色在 PowerShell 5.1 上都能生成以分号分隔的名称,且不会出现属性错误。
由索引模型根据 Issue 内容生成。
描述
Hi,
just encouraged an error while running one of your scripts. Seems like the object is not properly passed by piping it into Select-Object.
Error:
select : Property "displayName" cannot be found.
At line:1 char:112
+ ... --role Owner | ConvertFrom-Json | select -ExpandProperty displayName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: ( :PSObject) [Select-Object], PSArgumentException
+ FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand
Affects:
scripts/teams-list-teams-owners-and-members CLI for Microsoft 365 version
Fix:
$teamOwnerNames = (m365 teams user list --teamId $_.id --role Owner | ConvertFrom-Json | select -ExpandProperty displayName) -join ";"
-> $teamOwnerNames = (m365 teams user list --teamId $_.id --role Owner | ConvertFrom-Json).displayName -join ";"
$teamMemberNames = (m365 teams user list --teamId $_.id --role Member | ConvertFrom-Json | select -ExpandProperty displayName) -join ";"
-> $teamMemberNames = (m365 teams user list --teamId $_.id --role Member | ConvertFrom-Json).displayName -join ";"
$teamGuestNames = (m365 teams user list --teamId $_.id --role Guest | ConvertFrom-Json | select -ExpandProperty displayName) -join ";"
-> $teamGuestNames = (m365 teams user list --teamId $_.id --role Guest | ConvertFrom-Json).displayName -join ";"
PS Version:
Name Value
---- -----
PSVersion 5.1.19041.5007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.5007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
OS Windows 10
- 主要语言
- PowerShell
- 星标
- 349
- 派生
- 191
- 平均合并
- 4 天 8 小时
- 30 天内合并 PR
- 13
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pnp/script-samples 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
pnp/script-samples#1003 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
pnp/script-samples#996 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
pnp/script-samples#987 ·
维护者通常 1 天内回复
-
enhancement generator
难度 4/5 3-5 天 新手友好度 35/100
pnp/script-samples#924 ·
维护者通常 1 天内回复
-
Reformat Scripts folder into subgroups e.g. spo, entra, teams for maintainability improvements可能重新可做 @pkbullock 于 275 天前认领,目前没有进行中的 PR。 未关闭enhancement generator proposed
pnp/script-samples#906 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 pnp/script-samples 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 72/100
ScoopInstaller/Extras#18870 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
foundation/inky#334 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
NVIDIA/nvmesh-utils#9 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复