Advertisement
omareg94

Result of example

May 9th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PS C:\Users\MYUSERNAME> $OneNote = New-Object -ComObject OneNote.Application
  2. PS C:\Users\MYUSERNAME> $binding = "System.Reflection.BindingFlags" -as [type]
  3. PS C:\Users\MYUSERNAME> $active_window = [System.__ComObject].InvokeMember("CurrentWindow", $binding::GetProperty, $null, $OneNote, $null)
  4. Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
  5. At line:1 char:1
  6. + $active_window = [System.__ComObject].InvokeMember("CurrentWindow", $ ...
  7. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8.     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
  9.     + FullyQualifiedErrorId : COMException
  10.  
  11. PS C:\Users\MYUSERNAME> $active_window_pageId = [System.__ComObject].InvokeMember("CurrentPageId", $binding::GetProperty, $null, $active_window, $null)
  12. Exception calling "InvokeMember" with "5" argument(s): "Method 'System.__ComObject.CurrentPageId' not found."
  13. At line:1 char:1
  14. + $active_window_pageId = [System.__ComObject].InvokeMember("CurrentPag ...
  15. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16.    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
  17.    + FullyQualifiedErrorId : MissingMethodException
  18.  
  19. PS C:\Users\MYUSERNAME> Write-Output $active_window_pageId
  20. PS C:\Users\MYUSERNAME>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement