Created
December 2, 2025 21:39
-
-
Save SweetAsNZ/3d950f79af436b2978f02897a49bea2f to your computer and use it in GitHub Desktop.
Checks IE Mode Session State if Files Aren't Opening in IE Mode With Spinning Wheel on Edge Tab when you see multiple HTTP 302 errors in Fiddler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Test-IEModeSessionStateSetting { | |
| <# | |
| .SYNOPSIS | |
| Tests the Internet Explorer Mode session state settings for Microsoft Edge. | |
| .DESCRIPTION | |
| This function checks the registry for the Internet Explorer Mode session state settings | |
| in Microsoft Edge under both HKLM and HKCU paths. It reports whether the settings are enabled, disabled, or not set. | |
| Useful when IE Mode Files don't load with spinning wheel on Edge tab | |
| .EXAMPLE | |
| Test-IEModeSessionStateSetting | |
| This command runs the function to check the IE Mode session state settings. | |
| .NOTES | |
| Author: Tim West | |
| Company: Sweet As Chocolate | |
| Created: 03/12/25 | |
| Updated: 03/12/25 | |
| Status: WIP | |
| Version: 1.0.1 | |
| #> | |
| [CmdletBinding()] | |
| Param() | |
| # Check admin status | |
| $isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
| if (-not $isAdmin) { | |
| Write-Warning "This function requires Administrator privileges to read HKLM registry keys." | |
| Write-Warning "Please run PowerShell as Administrator or use 'Run as Administrator'" | |
| return | |
| } | |
| $paths = @( | |
| "HKLM:\SOFTWARE\Policies\Microsoft\Edge", | |
| "HKCU:\SOFTWARE\Policies\Microsoft\Edge" | |
| ) | |
| $keysToCheck = @( | |
| "InternetExplorerIntegrationComplexNavBehavior", | |
| "InternetExplorerIntegrationKeepSessionState" | |
| ) | |
| function Interpret-PolicyValue { | |
| param($key, $value) | |
| switch ($value) { | |
| 1 { return "$key = 1 (enabled)" } | |
| 0 { return "$key = 0 (disabled)" } | |
| default { return "$key is set to '$value' (unexpected value, congratulations)" } | |
| } | |
| } | |
| foreach ($path in $paths) { | |
| Write-Host "`nChecking path: $path" -ForegroundColor Cyan | |
| foreach ($key in $keysToCheck) { | |
| try { | |
| $value = Get-ItemProperty -Path $path -Name $key -ErrorAction Stop | Select-Object -ExpandProperty $key | |
| Write-Host (Interpret-PolicyValue -key $key -value $value) -ForegroundColor Green | |
| } catch { | |
| Write-Host "$key not set (policy not applied here)" -ForegroundColor Yellow | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment