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

Import-Module PSPKI always needed #115

Closed
Pixelfool opened this issue Sep 1, 2020 · 8 comments
Closed

Import-Module PSPKI always needed #115

Pixelfool opened this issue Sep 1, 2020 · 8 comments
Labels
Investigate The item’s status is investigated (issue or not) wontfix The behavior is by design, or we don't have an ability to fix this due to API restrictions.

Comments

@Pixelfool
Copy link

When I try to use PSPKI after installing or opening a ne PowerShell instance, I need to load it with Import-Module.
I am using Windows Server 2019.
It also wont show up in Get-Modules until I import it again.

@Crypt32 Crypt32 added the non-issue Misconfiguration on client end or behavior is expected and by design label Sep 1, 2020
@Crypt32
Copy link
Collaborator

Crypt32 commented Sep 1, 2020

It is expected behavior since Windows PowerShell 5+. PowerShell no longer autoloads the module by simply calling a command from installed and non-loaded module. Use Get-Module -ListAvailable to get a list of installed modules.

@Pixelfool
Copy link
Author

Interesting.
Other modules load automatically. Only PSPKI does not

@Crypt32
Copy link
Collaborator

Crypt32 commented Sep 1, 2020

How did you install the module? What is your $PSVersionTable? What returns $PSModuleAutoloadingPreference?

@Pixelfool
Copy link
Author

I installed it with "Install-Module -Name PSPKI"

$PSVersionTable:

Name Value


PSVersion 5.1.17763.592
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.592
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

$PSModuleAutoloadingPreference is empty but according to Microsoft this means "all"

@dennisl68-castra
Copy link

I've got the same issue (as listed by duplicate).
PoSH 5.1 does load modules dynamically.

Impot-Module is normally not a requirement as long as the module is stored in a folder listed by $env:PSModulePath

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 15, 2021

I've got the same issue (as listed by duplicate).
PoSH 5.1 does load modules dynamically.

Impot-Module is normally not a requirement as long as the module is stored in a folder listed by $env:PSModulePath

Is PSPKI module installed in a path referenced in $env:PSModulePath? Where exactly PSPKI is installed?

@Crypt32 Crypt32 added Investigate The item’s status is investigated (issue or not) and removed non-issue Misconfiguration on client end or behavior is expected and by design labels Feb 15, 2021
@dennisl68-castra
Copy link

dennisl68-castra commented Feb 15, 2021

It's installed using Install-Module pspki -Scope CurrentUser

C:> get-module pspki -ListAvailable


    Directory: C:\Users\XXXXX\Documents\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     3.7.2      PSPKI                               {Add-AdCertificateRevocationList, Start-PsFCIV, Get-AdPkiConta...

@Crypt32 Crypt32 added the wontfix The behavior is by design, or we don't have an ability to fix this due to API restrictions. label Sep 18, 2023
@Crypt32
Copy link
Collaborator

Crypt32 commented Sep 18, 2023

Unable to repro. Additional details needed. As a general recommendation, call Import-Module PSPKI explicitly before using it. Seems module autoload isn't reliable in all cases.

@Crypt32 Crypt32 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate The item’s status is investigated (issue or not) wontfix The behavior is by design, or we don't have an ability to fix this due to API restrictions.
Projects
None yet
Development

No branches or pull requests

3 participants