TestimoX

API Reference

Class

PowerShellModuleNotFoundException

Namespace TestimoX.Exceptions
Assembly TestimoX
Base Exception
Implements
ISerializable

Exception thrown when a required PowerShell module cannot be found.

Inheritance

  • Exception
  • PowerShellModuleNotFoundException

Remarks

Thrown when Import-Module fails to locate the specified module.

Examples


try {
    // Attempt to import a module
} catch (PowerShellModuleNotFoundException ex) {
    Console.WriteLine($"Module {ex.ModuleName} missing: {ex.Message}");
}

        

Constructors

public PowerShellModuleNotFoundException(String moduleName, String message) #

Creates a new instance indicating the specified module was not found.

Parameters

moduleName System.String requiredposition: 0
Module that failed to load.
message System.String requiredposition: 1
Human-readable error message.

Properties

public String ModuleName { get; } #

Name of the missing PowerShell module.