GithubHelp home page GithubHelp logo

A parameter cannot be found that matches parameter name 'DefaultVault' IF installing with "-Scope AllUsers" about secretmanagement HOT 9 CLOSED

powershell avatar powershell commented on May 29, 2024
A parameter cannot be found that matches parameter name 'DefaultVault' IF installing with "-Scope AllUsers"

from secretmanagement.

Comments (9)

issue-label-bot avatar issue-label-bot commented on May 29, 2024 1

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from secretmanagement.

PaulHigin avatar PaulHigin commented on May 29, 2024

Be sure and uninstall (or just manually remove) any older version of SecretManagement module. SecretStore is compatible only with SecretManagement version 0.5.2-preview3. Get-Module should show only the latest version installed:

Get-Module microsoft.powershell.secretmanagement -list

    Directory: C:\Users\user\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     0.5.2      preview3   Microsoft.PowerShell.SecretManagem… Core      {Register-SecretVault, Unregister-Secre

from secretmanagement.

TheBigBear avatar TheBigBear commented on May 29, 2024

@PaulHigin I had uninstalled all previous modules using -AllVersions . But didn't mention this was/is on a Mac. Sorry.
Same command actually works on Windows. So the SecretStore has no '-DefaultVault' on a Mac not even the new .Net Microsoft.PowerShell.SecretStore one? I thought this was now supposed to be cross platform and support this new Vault on all?

from secretmanagement.

PaulHigin avatar PaulHigin commented on May 29, 2024

Actually I haven't tested this on a Mac yet. I have tested it on Ubuntu 18.04 and all behaviors and tests run as expected.
I'll test on Mac today, but I would be very surprised if it didn't work there. But will let you know.

from secretmanagement.

PaulHigin avatar PaulHigin commented on May 29, 2024

I have tested this on a Mac and have not been able to repro this issue. I can only think that you may still have an older version of SecretManagement installed. The Mac I tested on didn't have any previous versions and this worked:

Install-Module Microsoft.PowerShell.SecretManagement -AllowPrerelease -Repository PSGallery
Install-Module Microsoft.PowerShell.SecretStore -AllowPrerelease -Repository PSGallery
Register-SecretVault -Name SecretStore -ModuleName Microsoft.PowerShell.SecretStore -DefaultVault

from secretmanagement.

PaulHigin avatar PaulHigin commented on May 29, 2024

Closing this as answered.

from secretmanagement.

TheBigBear avatar TheBigBear commented on May 29, 2024

@PaulHigin ok, I retested as well, and even though I had used uninstall-module for both the Store and Management there were still files left over. See my log below ( or is this expected? are those dlls supposed to be leftover on the Mac after an uninstall-module ? ) (they had been installed using -Scope AllUsers - if that makes any diff? )

PS /Users/user> Uninstall-Module Microsoft.Powershell.SecretStore -AllVersions                                                                                                         

PS /Users/user> Uninstall-Module Microsoft.Powershell.SecretManagement -AllVersions                                                                                                    

PS /Users/user> Get-Module Microsoft.PowerShell.*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     0.5.2      preview3   Microsoft.PowerShell.SecretManagem… {Get-Secret, Get-SecretInfo, Get-SecretVault, Register-SecretVault…}
Binary     0.5.1      preview1   Microsoft.PowerShell.SecretStore    {Get-SecretStoreConfiguration, Reset-SecretStore, Set-SecretStoreConfiguration, Unlock-SecretStore…}

PS /Users/user> Remove-Module Microsoft.PowerShell.SecretManagement -
Force                Confirm              Debug                WarningAction        ErrorVariable        InformationVariable  OutBuffer            
WhatIf               Verbose              ErrorAction          InformationAction    WarningVariable      OutVariable          PipelineVariable     

PS /Users/user> Remove-Module Microsoft.PowerShell.SecretManagement -Force -Verbose
VERBOSE: Performing the operation "Remove-Module" on target "Microsoft.PowerShell.SecretManagement (Path: '/Users/user/.local/share/powershell/Modules/Microsoft.PowerShell.SecretManagement/0.5.2/Microsoft.PowerShell.SecretManagement.dll')".

PS /Users/user> Remove-Module Microsoft.PowerShell.SecretStore -Force -Verbose     
VERBOSE: Performing the operation "Remove-Module" on target "Microsoft.PowerShell.SecretStore.Extension (Path: '/Users/user/.local/share/powershell/Modules/Microsoft.PowerShell.SecretStore/0.5.1/Microsoft.PowerShell.SecretStore.Extension/Microsoft.PowerShell.SecretStore.Extension.psm1')".
VERBOSE: Performing the operation "Remove-Module" on target "Microsoft.PowerShell.SecretStore (Path: '/Users/user/.local/share/powershell/Modules/Microsoft.PowerShell.SecretStore/0.5.1/Microsoft.PowerShell.SecretStore.dll')".

PS /Users/user> Get-Module Microsoft.PowerShell.*                                  

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------

Now that I used remove-module for Store and Management after having uninstalled those two first I am now re-installing it and it accepts the -DefaultValue parameter.

from secretmanagement.

TheBigBear avatar TheBigBear commented on May 29, 2024

@PaulHigin , sorry to come back on this again. I have now redone it and this time I removed all traces again of both modules and then installed it with '-Scope AllUsers' ( like I had done at the very beginning ) and if I install it for all users then it actually tells me that the parameter '-DefaultValue' does not exist.
Thinking about it, this might even be expected?

from secretmanagement.

PaulHigin avatar PaulHigin commented on May 29, 2024

I'm sorry you are having so much trouble with this. We know that PowerShellGet (V2 and V3) has trouble with prerelease modules with dependencies. I hope it gets addressed soon. I am guessing it is installing the wrong version.

Try removing the modules again and installing only using the command lines I show above. When I was experimenting before, I ran into different PowerShellGet install issues, but after I found the above command lines worked I didn't look into it any deeper.

If you need to move the module location (for AllUsers access), you can do that manually by simply copying the directories.
Not an ideal situation I agree, but should get you going.

from secretmanagement.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.