Closed marckassay closed 4 years ago
Ah, yes that conflict was slightly intentional but now that PKI works with PS 7 we might want to consider renaming the command of this module with a prefix.
Also, since PKI is a Windows in-box module that lives on the module path, Remove-Module
won't really help the Install-Module
case. So these instructions may not be the ideal.
Really this module is not intended to be installed so much as saved, imported and used in small ways. I'll discuss with @adityapatwardhan about whether I can rename the command.
It was in the Azure docs where I saw a link to this repo, where I attempted to use this module to create a certificate for authenticating to Azure Container Registry. I haven't dealt with installed modules having the same function names, where my initial attempt failed as PowerShell was selecting the function of PkiClient module, and not SelfSignCertificate. You are probably correct about the usage of Remove-Module
followed by Install-Module
, but from my experience it seemed to change order of precedence for PowerShell when choosing between which function is the user referring to.
Typing this comment, I just recalled specifying the: module-name followed by backward-slash, followed by function-name, might of been a solution to prevent using the unintended function. Example below:
SelfSignedCertificate\New-SelfSignedCertificate
Yeah the fully qualified command name SelfSignedCertificate\New-SelfSignedCertificate
is designed specifically to resolve the command clobber problem.
But if Azure docs are recommending this module, I should probably just rename the command.
This module's reason for being is as part of the build process for PowerShell 7 though, so I'll need to make sure they can deal with the change.
I think what I added is correct, as it seems to be from what I'm experiencing.
This should mitigate any issues during install for systems with PkiClient module installed.