PowerShellExecutionPolicy doesn't allow multiple 'CurrentUser' assignments
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- powershell
- Lĩnh vực
- devops, operating-systems
Hướng nghiên cứu
Bắt đầu bằng cách đọc resource PowerShellExecutionPolicy hiện có và cấu hình DSC được cung cấp trên Windows PowerShell 5.1. Xác định cách resource PowerShellUserExecutionPolicy dành riêng cho credential cần hỗ trợ nhiều assignment CurrentUser, sau đó xác minh rằng các resource Builder và Publisher riêng biệt có thể được biên dịch mà không gặp lỗi trùng lặp xung đột.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem description
Powershell 5.1 DSC doesn't allow you to specify the same ExecutionPolicy for ExecutionPolicyScope 'CurrentUser' but different PsRunAsCredentials, meaning you can't assign it to multiple specific users.
Verbose logs
Test-ConflictingResources : A conflict was detected between resources '[PowerShellExecutionPolicy]Builder (::8::5::PowerShellExecutionPolicy)' and '[PowerShellExecutionPolicy]Publisher
(::9::5::PowerShellExecutionPolicy)' in node 'localhost'. Resources have identical key properties but there are differences in the following non-key properties: 'PsDscRunAsCredential'.
Values 'System.Management.Automation.PSCredential' don't match values 'System.Management.Automation.PSCredential'. Please update these property values so that they are identical in both
cases.
At line:289 char:9
+ Test-ConflictingResources $keywordName $canonicalizedValue $k ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], InvalidOperationException
+ FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
Compilation errors occurred while processing configuration 'FailSample'. Please review the errors reported in error stream and modify your configuration code appropriately.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5
+ throw $ErrorRecord
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (FailSample:String) [], InvalidOperationException
+ FullyQualifiedErrorId : FailToProcessConfiguration
DSC configuration
{
Param([Parameter(Mandatory)][PSCredential]$Builder, [Parameter(Mandatory)][PSCredential]$Publisher)
Import-DscResource -ModuleName ComputerManagementDsc
Node localhost
{
PowerShellExecutionPolicy Builder { ExecutionPolicy='RemoteSigned'; ExecutionPolicyScope='CurrentUser'; PsDscRunAsCredential = $Builder }
PowerShellExecutionPolicy Publisher { ExecutionPolicy='RemoteSigned'; ExecutionPolicyScope='CurrentUser'; PsDscRunAsCredential = $Publisher }
}
}
Sample -Verbose -ConfigurationData:@{AllNodes=@(@{NodeName='localhost'; PsDscAllowPlainTextPassword=$true})}
Suggested solution
Add PowerShellUserExecutionPolicy which doesn't take scope and requires a credential.
PowerShellUserExecutionPolicy Builder
{
ExecutionPolicy = 'RemoteSigned' ; Credential = $builder
}
PowerShellUserExecutionPolicy Publisher
{
ExecutionPolicy = 'RemoteSigned' ; Credential = $publisher
}
Operating system the target node is running
OsName : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
ComputerManagementDsc version
Name Version Path
---- ------- ----
ComputerManagementDsc 8.5.0 C:\Program Files\WindowsPowerShell\Modules\ComputerManagementDsc\8.5.0\ComputerManage
mentDsc.psd1
- Ngôn ngữ chính
- PowerShell
- Star
- 338
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dsccommunity/ComputerManagementDsc
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
chore: Add Agentic AI development assets for GitHub CopilotCó thể đã có người làm @PlagueHO đã nhận 110 ngày trước. Đang mởchore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
Computer: AD object deletion before domain join issueCó thể đã có người làm @Daymarvi đã nhận 113 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của dsccommunity/ComputerManagementDsc
Issue tương tự
-
[Bug] create-before-destroy replacements are omitted from driftCó thể đã có người làm @Lostmanu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
InditexTech/kumoss#318 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deploy & Patch-issues opprettes ikke: create-pnd-issues.yml har feilet hver uke siden 2025-09-08Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Altinn/altinn-auth#4359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
WingedGuardian/GENesis-AGI#3126 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws-samples/appmod-blueprints#972 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The CSS is not lintedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
WordPress/presence-api#807 ·
Maintainer thường phản hồi trong vòng 1 ngày