IE Com Object, Difference between .Navigate and .Navigate2 Methods

What is the difference between $ie.Navigate("URL")and$ie.Navigate2("URL") ?

Get-Member says:

Navigate       Method    void Navigate (string, Variant, Variant, Variant, Variant)  
Navigate2      Method    void Navigate2 (Variant, Variant, Variant, Variant, Variant)

Sample code:

$ie = New-Object -ComObject InternetExplorer.Application
$ie.visible = $true

$ie.Navigate("www.stackoverflow.com")
#or
$ie.Navigate2("www.stackoverflow.com")
+4
source share
1 answer

The difference is in the first argument URL. Here is what MSDN says:

Navigation method

URL: A string expression that evaluates the URL, full path, or UNC location and name of the displayed resource.

Navigate2 Method

URL: a variable or expression that matches the URL of the displayed resource, the full path to the file location, or PIDL, representing the folder in the shell namespace.

...

Navigate, Shell; Navigate . URL.

+5

Source: https://habr.com/ru/post/1782261/


All Articles