API Reference
Class
InstallAndImportStrategy
Strategy that attempts to install the module from PSGallery then import it.
Inheritance
- Object
- InstallAndImportStrategy
Remarks
If the module is not already installed, this strategy will install it using Install-Module and then import it.
Examples
var strategy = new InstallAndImportStrategy();
var result = await strategy.LoadAsync("DnsServer", CancellationToken.None);
Constructors
public InstallAndImportStrategy() #Methods
public virtual async Task<ModuleLoadResult> LoadAsync(String moduleName, CancellationToken cancellationToken) #Returns:
Task<ModuleLoadResult>Parameters
- moduleName System.String
- cancellationToken System.Threading.CancellationToken