en-us/Automating_Private_Mode.walkthru.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
# To interact with a browser while it's in Private mode, you need to launch IE with -private, and the URL
$launchIt = Start-Process -FilePath "iexplore.exe" -ArgumentList "-private", "https://sitethatisprobablynsfw.com"
 
# Then wait for all browsers to be ready (since it might not have the location set correctly yet)
Get-Browser |
    Wait-Browser
 
# Then, find the browser that is pointed to your URL. Beware that it may take a second for the brower to load, and it
Get-Browser |
    Where-Object { $_.LocationUrl -like 'https://sitethatisprobablynsfw.com*' } |
    Select-Object -First 1