invokemethodonnull powershell try catch
PS C:ScriptsPowerShell> C:ScriptsPowerShellAdd SA3CloudAdd-SA3Cloud.ps1
Office is: \sa3cloudLOPD
Location is LOPD
WARNING: \sa3cloudLOPD
WARNING: System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)