TestimoX

API Reference

Class

InstallAndImportStrategy

Namespace TestimoX.PowerShell
Assembly TestimoX

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 requiredposition: 0
cancellationToken System.Threading.CancellationToken requiredposition: 1