Skip to content

You cannot call a method on a null-valued expression. #108

@kokul22

Description

@kokul22

Hi Everyone,

I'm new to powershell. But found this tool very helpful so i'd though to test it in my lab environment. whenever i ran any built in script inside the module i'm getting below error.

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\PSADHealth\0.0.7\PSADHealth.psm1:83 char:9

  •     $msg.To.Add("$target")
    
  •     ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\PSADHealth\0.0.7\PSADHealth.psm1:83 char:9

  •     $msg.To.Add("$target")
    
  •     ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Send-MailMessage : A parameter cannot be found that matches parameter name 'ReplyTo'.
At C:\Program Files\WindowsPowerShell\Modules\PSADHealth\0.0.7\PSADHealth.psm1:108 char:22

  • Send-MailMessage @mail
    
  •                  ~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions