📜  invokemethodonnull powershell try catch - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:06.188000             🧑  作者: Mango

代码示例1
PS C:\Scripts\PowerShell> C:\Scripts\PowerShell\Add SA3Cloud\Add-SA3Cloud.ps1
Office is: \\sa3cloud\LOPD
Location is LOPD
WARNING: \\sa3cloud\LOPD
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)