Inappropriate references to ushort type in New-DkimSigningConfig and Rotate-DkimSigningConfig.
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- backend
调研方向
Find the definitions of New-DkimSigningConfig and Rotate-DkimSigningConfig in the ExchangeOnlineManagement module and inspect their KeySize parameter types. Check how similar parameters are typed elsewhere in the module, then verify that both commands can be called under Windows PowerShell 5.1. Done means neither function fails with a type lookup error.
由索引模型根据 Issue 内容生成。
描述
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
According to the documentation, for the ExchangeOnlineManagement module:
"All versions of the module are supported in Windows PowerShell 5.1."
Yet, since 3.5.0, two functions have declared parameters using the [ushort] type, which does not exist in the .NET Framework, causing both functions to fail under Windows PowerShell with the "unable to find type [ushort]" error. The issue still exists in 3.6.0.
This is not an issue under PowerShell (as distinct from Windows PowerShell) where an additional library declares the ushort type (system.private.corelib).
Example from New-DkimSigningConfig showing inappropriate ushort declaration for KeySize parameter:
`function script:New-DkimSigningConfig
{
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')]
param(
[string]
${AdminDisplayName},
${BodyCanonicalization},
[Parameter(Mandatory=$true, Position=0)]
${DomainName},
[Parameter(Mandatory=$true, Position=1)]
[bool]
${Enabled},
${HeaderCanonicalization},
[ValidateSet('1024','2048')]
[ushort]
${KeySize}
)
`
Expected behavior
That the commands declare the "KeySize" parameter using either [uint16] (if for some reason it must be a 16-bit value) or - in line with the rest of the module's functions - [uint32] (which to my mind would be more consistent).
This would resolve the type exception while maintaining compatibility on Windows PowerShell.
Actual behavior
Under Windows PowerShell, calls to both New-DkimSigningConfig and Rotate-DkimSigningConfig fail immediately (before function entry) on account of the ushort type not existing, as shown in the screenshot.
Error details
Unable to find type [ushort].
At C:\Users\lain.robertson\AppData\Local\Temp\tmpEXO_faj3kift.kut\tmpEXO_faj3kift.kut.psm1:25026 char:5
+ [ushort]
+ ~~~~~~~~
+ CategoryInfo : InvalidOperation: (ushort:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
Environment data
PS D:\Data> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.4894
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.4894
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
3.6.0
Visuals
- 主要语言
- PowerShell
- 星标
- 289
- 派生
- 83
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PowerShellGallery 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
PowerShell/PowerShellGallery#357 · 3 条评论 · 4 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 48/100
PowerShell/PowerShellGallery#355 ·
-
难度 4/5 3-5 天 新手友好度 31/100
PowerShell/PowerShellGallery#354 · 1 条评论 · 3 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
PowerShell/PowerShellGallery#353 · 5 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 48/100
PowerShell/PowerShellGallery#350 · 7 条评论 · 8 个 reaction ·
查看 PowerShell/PowerShellGallery 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
5.0.x backport enhancement
难度 2/5 1-3 小时 新手友好度 63/100
spring-cloud/spring-cloud-function#1507 ·
维护者通常 1 天内回复
-
bug v2
难度 2/5 1-3 小时 新手友好度 79/100
modelcontextprotocol/python-sdk#3810 ·
维护者通常 1 天内回复
-
apps/stage-tamagotchi bug env/os-windows extension/channel-discord pending triage scope/engineering scope/extension
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
cost:cheap practicality:seen-in-the-wild severity:medium
难度 2/5 1-3 小时 新手友好度 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
维护者通常 1 天内回复