I am trying to modify a vbscript and convert it to Powershell as instructed. I have a block of code on my function SearchAD with On Error.
on error resume ne
In VBScript there are two error states (three in other VBs).
On Error Goto 0
vbscript handles errors. Your program crashes on errors.
On Error Resume Next
VBScript sets the err object but doesn't raise an error. You are required to put after every line that may raise an error
If err.number <> 0 then
FreakoutAndFixTheError
err.clear
wscript.quit 'if you can't fix
End If
In VB6 and VBA there is also
On Error Goto LineNumber (or a label)