aaearon / SecretManagement.CyberArk

A SecretManagement extension for CyberArk.
https://timschindler.blog/secretmanagementcyberark-an-extension-for-the-secretmanagement-powershell-module
MIT License
12 stars 0 forks source link

Fixed version of Microsoft.PowerShell.Secretmanagement required #13

Closed RichardGardener closed 2 years ago

RichardGardener commented 2 years ago

I've just tried to install this module and I got the following error;

PackageManagement\Install-Package : The following commands are already available on this
system:'Get-Secret,Get-SecretInfo,Remove-Secret,Set-Secret,Test-SecretVault'. This module 'SecretManagement.CyberArk'
may override the existing commands. If you still want to install this module 'SecretManagement.CyberArk', use
-AllowClobber parameter.

Checking the file SecretManagement.CyberArk.psd1 it has the follow required module set;

RequiredModules = @(
    'psPAS',
    @{
        ModuleName = 'Microsoft.Powershell.SecretManagement'
        ModuleVersion = '1.0.0'
    }
)

The current version on PSGallery is 1.1.1, which I has installed on my computer.

Would it be possible to remove the ModuleVersion or update it to allow more recent versions?

aaearon commented 2 years ago

According to https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest?view=powershell-7.2#module-manifest-elements, when ModuleVersion is defined, then "it will load the newest version available with a minimum of the version specified."

I am also unable to reproduce with PS 7.1.5

tim@Tims-MBP  ~  pwsh
PowerShell 7.1.5
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

   A new PowerShell stable release is available: v7.2.0
   Upgrade now, or check out the release page at:
     https://aka.ms/PowerShell-Release?tag=v7.2.0

Loading personal and system profiles took 712ms.
PS /Users/tim> import-module SecretManagement.CyberArk
PS /Users/tim> Get-Module

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-It…
Binary     1.1.1                 Microsoft.PowerShell.SecretManagem… {Get-Secret, Get-SecretInfo, Get-SecretVault, Reg…
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Ob…
Script     4.5.90                psPAS                               {Add-PASAccount, Add-PASAccountACL, Add-PASAccoun…
Script     2.2.0      beta2      PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, …
Manifest   0.3                   SecretManagement.CyberArk           {Get-Secret, Get-SecretInfo, Remove-Secret, Set-S…
Script     0.5.0                 Terminal-Icons                      {Add-TerminalIconsColorTheme, Add-TerminalIconsIc…

PS /Users/tim>
RichardGardener commented 2 years ago

I think it's something on the work laptop that's causing the warnings so I'll close this issue. Thank you for checking and supplying this module.