Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The big bear fix keychain setup #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

TheBigBear
Copy link

the Test-SecretVault param for VaultName has been changed from -VaultName to simply -Name and the modules version has bee increased to 0.1.3

@TheBigBear
Copy link
Author

There is more work needed though to get this to finally work.

I do not understand line 41 why this is assigned to $null ? ( you can't assign anything to $null !? ) in [SecretManagement.KeyChain.psm1] in function Get-KeyChainConfiguration?

function Get-KeyChainConfiguration {
    [CmdletBinding()]
    param ()

    $null = Test-SecretVault -Name $keyChainName
    $out = & $securityCmd show-keychain-info $keyChainName 2>&1

And another question is IF I try to run the Test-SecretVault -Name KeyChain, with the correct new param -Name it fails and complains about not having a 'test' dir under /usr/local/share/powershell/Modules/SecretManagement.KeyChain/0.1.3/ without that directory 'test' it fails with:

Test-SecretVault: Program 'security' failed to run: An error occurred trying to start process '/usr/bin/security' with working directory '/usr/local/share/powershell/Modules/SecretManagement.KeyChain/0.1.3/test'. No such file or directoryAt /Users/urs.rau/Downloads/SecretManagement.KeyChain/src/SecretManagement.KeyChain/SecretManagement.KeyChain.Extension/SecretManagement.KeyChain.Extension.psm1:328 char:12
+     $out = & $securityCmd show-keychain-info $keyChainName 2>&1 | Out …
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
Test-SecretVault: Cannot bind argument to parameter 'Message' because it is null.
Test-SecretVault: Program 'security' failed to run: An error occurred trying to start process '/usr/bin/security' with working directory '/usr/local/share/powershell/Modules/SecretManagement.KeyChain/0.1.3/test'. No such file or directoryAt /Users/urs.rau/Downloads/SecretManagement.KeyChain/src/SecretManagement.KeyChain/SecretManagement.KeyChain.Extension/SecretManagement.KeyChain.Extension.psm1:333 char:9
+         & $securityCmd create-keychain -P $keyChainName
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
Test-SecretVault: Program 'security' failed to run: An error occurred trying to start process '/usr/bin/security' with working directory '/usr/local/share/powershell/Modules/SecretManagement.KeyChain/0.1.3/test'. No such file or directoryAt /Users/urs.rau/Downloads/SecretManagement.KeyChain/src/SecretManagement.KeyChain/SecretManagement.KeyChain.Extension/SecretManagement.KeyChain.Extension.psm1:335 char:16
+ …      $out = & $securityCmd show-keychain-info $keyChainName 2>&1 | Ou …
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
Test-SecretVault: Cannot bind argument to parameter 'Message' because it is null.

But if I manually create that dir then the Test succeeds and reports True but in your code that would be assigned to $null in line 41?

@TheBigBear
Copy link
Author

@DonPwrShellHunt can you look over this and comment and help fix this, please?

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.

1 participant