On an older Windows 8.1 machine, I have to use Import-Module -SkipEditionCheck Storage
every time I want to use VHD related commands from Powershell. But unlike what the command seem to imply, it's not actually importing the module, but merely loading it. Because I need to run it every time I start pwsh.
How can I make that module import stay permanent?
UPDATE: 2020-01-26
From the About Modules page:
Also, commands that use PowerShell providers do not automatically import a module. For example, if you use a command that requires the
WSMan: drive
, such as theGet-PSSessionConfiguration
cmdlet, you might need to run the Import-Module cmdlet to import theMicrosoft.WSMan.Management
module that includes theWSMan: drive
.You can still run the
Import-Module
command to import a module and use the$PSModuleAutoloadingPreference
variable to enable, disable and configure automatic importing of modules. For more information, see ...
And from the About Preferences page for $PSModuleAutoloadingPreference
:
Enables and disables automatic importing of modules in the session. All is the default. Regardless of the variable's value, you can use Import-Module to import a module.
Valid values are:
All
: Modules are imported automatically on first-use. To import a module, get or use any command in the module. For example, use Get-Command.
ModuleQualified
: Modules are imported automatically only when a user uses the module-qualified name of a command in the module. For example, if the user types MyModule\MyCommand, PowerShell imports the MyModule module.
None
: Automatic importing of modules is disabled in the session. To import a module, use the Import-Module cmdlet.
However, my $PSModuleAutoloadingPreference
is empty...