Hi everyone!
Anyone know of a way to check if my Client connection is valid before I get a {VMware.Vim.NotAuthenticated} on FindEntityView line? I would like to check before having to resort to Catch Ex as Vmware.VimFault exception!?
Thanks!!
-NHALL
Public Function GetVMFolder(ByVal VMFolderName As String) As VMware.Vim.ManagedObjectReference
Try
If VMFolders Is Nothing Then
VMFolders = Client.FindEntityViews(GetType(VMware.Vim.Folder), Nothing, Nothing, Nothing)
Dim I As Integer = 0
For Each tmp As VMware.Vim.Folder In VMFolders
Debug.WriteLine(I & ") " & tmp.Name)
I += 1
Next
End If
For Each tmp As VMware.Vim.Folder In VMFolders
If tmp.Name = VMFolderName Then
Return tmp.MoRef
End If
Next
Catch ex As Exception
Return Nothing
End Try
End Function