Skip to content

Windows secret store - no secret #1510

Open
mimachniak wants to merge 3 commits intoPowerShell:mainfrom
mimachniak:windows_secret_store
Open

Windows secret store - no secret #1510
mimachniak wants to merge 3 commits intoPowerShell:mainfrom
mimachniak:windows_secret_store

Conversation

@mimachniak
Copy link
Copy Markdown
Contributor

Introduces windows_secretstore.ps1, a DSC v3 resource script that manages the configuration of the Microsoft.PowerShell.SecretStore vault using the standard Get/Set/Test pattern.

What's Changed
Get – Retrieves the current SecretStore configuration (authentication, passwordTimeout, interaction, scope) and optionally unlocks the store with a provided password.
Set – Applies the desired configuration via Set-SecretStoreConfiguration. Falls back to Reset-SecretStore when running in a non-interactive session or when transitioning from None to Password authentication mode.
Test – Compares the current configuration against the desired state and returns _inDesiredState in the output JSON.

Copilot AI review requested due to automatic review settings May 3, 2026 19:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new DSC v3 PowerShell-script-based resource to manage the Microsoft.PowerShell.SecretStore vault configuration on Windows, with a bundled manifest and Pester coverage to exercise dsc config get/set/test scenarios.

Changes:

  • Introduces Microsoft.PowerShell/WindowsSecretStore resource script implementing Get/Set/Test for SecretStore configuration.
  • Adds a v3 resource manifest defining execution and an embedded JSON schema for resource properties.
  • Adds Windows-only Pester tests that apply and validate none-auth and password-auth configurations via dsc config.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
resources/windows_secretstore/windows_secretstore.ps1 Implements the resource logic (Get/Set/Test) and error/trace handling, including a Reset-SecretStore fallback path.
resources/windows_secretstore/windows_secretstore.dsc.resource.json Registers the resource entrypoint and defines the embedded schema for supported properties/outputs.
resources/windows_secretstore/test/windows_secretstore.config.tests.ps1 Adds end-to-end Pester tests using dsc config commands for none-auth and password-auth cases.
resources/windows_secretstore/.project.data.json Adds build packaging metadata to copy the script and manifest for Windows builds.

Comment on lines +18 to +22
if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue)) {
Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force -Scope CurrentUser | Out-Null
}

Install-Module -Name $Name -Repository PSGallery -Scope CurrentUser -Force -AllowClobber -Confirm:$false -ErrorAction Stop
"CurrentUser",
"AllUsers"
]
},
Comment on lines +67 to +76
"authentication": {
"title": "Authentication",
"description": "Specifies whether the SecretStore vault requires a password for access. This DSC resource runs non-interactively and only supports 'None' for unattended automation.",
"type": "string",
"enum": [
"None",
"Prompt",
"Password"
]
},
],
"default": null
}
}
Comment on lines +309 to +310
Write-DscTrace -Level Warn -Message (
"$reason Attempting Reset-SecretStore with desired settings to enable unattended DSC execution."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants