How to start Microsoft Edge in private mode by PowerShell

This sample demonstrates how to start Microsoft Edge in InPrivate mode by PowerShell.

 
 
 
 
 
(0)
504 times
Add to favorites
5/3/2017
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Can StartEdgeBrowserPrivateMode Script be fixed for creators
    3 Posts | Last post May 07, 2018
    • The script StarEdgeBrowserPrivateMode from this website opens Edge (Windows 10 Creator), but not inPrivate mode.
      
      Can someone correct it and add a few instructions on how to create a desktop shortcut for a specific URL?
      Thanks in advance - Lee Gordon
    • Since we can't find a solution to launch private mode by passing parameter, we achieve the purpose by invoking the shortcut key for private mode. We tested the sample on Windows 10 Creator locally and it works well. Could you provide us more information or try to press Ctrl + Shift + P in Edge to ensure whether it can open private mode manually?
      
      You can download the sample from https://gallery.technet.microsoft.com/How-to-create-a-desktop-9b17ee36 to create desktop shortcut to start Edge for specific URL.
    • If you want this to work correctly, by opening a single in private browser window - the modified script below addresses the extra window (in the background)
      
      Function StartEdgeBrowserPrivateMode
      {
          Start-Process -FilePath ($Env:WinDir + "\explorer.exe") -ArgumentList "shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"
          Start-Sleep -Seconds 5
          Select-Object
          [System.Windows.Forms.SendKeys]::SendWait("^+{P}")  
      Start-Sleep -Seconds 1
          [System.Windows.Forms.SendKeys]::SendWait("^{F4}")
      }
      StartEdgeBrowserPrivateMode