PSADHealth icon indicating copy to clipboard operation
PSADHealth copied to clipboard

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

Open kokul22 opened this issue 11 months ago • 0 comments

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

kokul22 avatar Feb 28 '24 22:02 kokul22