PowerShellExecutionPolicy doesn't allow multiple 'CurrentUser' assignments
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- powershell
調査の方向性
まず、既存の PowerShellExecutionPolicy リソースと、Windows PowerShell 5.1 で提供されている DSC 構成を読みます。資格情報固有の PowerShellUserExecutionPolicy リソースが複数の CurrentUser 割り当てをサポートする方法を定義し、その後、個別の Builder リソースと Publisher リソースを、競合する重複エラーなしでコンパイルできることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- PowerShell
- スター
- 338
- フォーク
- 80
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dsccommunity/ComputerManagementDsc のほかの issue
-
chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
chore
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
chore: Add Agentic AI development assets for GitHub Copilot対応中かも @PlagueHO が 109 日前に担当しました。 オープンchore
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
Computer: AD object deletion before domain join issue対応中かも @Daymarvi が 112 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
dsccommunity/ComputerManagementDsc の issue をすべて見る
似ている issue
-
Deploy & Patch-issues opprettes ikke: create-pnd-issues.yml har feilet hver uke siden 2025-09-08オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Altinn/altinn-auth#4359 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-samples/appmod-blueprints#972 ·
メンテナーはふだん 1 日以内に返信
-
lens:agent lens:process process
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
thebristolsound/birdbrain#1771 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area:ops priority:P2 type:chore
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
skaiy/wild_agentos#407 ·
メンテナーはふだん 1 日以内に返信