Fjern melding om at MS Edge har kræsja
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge]
"HideRestoreDialogEnabled"=dword:00000001
# Hide Edge Crashed-bubble
$file = "$($env:localAppData)\Microsoft\Edge\User Data\Default\Preferences"
if ($args.count -ge 1) {
$text1="Hjelp `r`n"
$text2="Setter Edge exit_type til Normal i filen:`n"
$text3=$file + "`n"
$text4="Ingen parameter nødvendig for å kjøre`n"
Write-Host $text1 $text2 $text3 $text4
}
$file = "$($env:localAppData)\Microsoft\Edge\User Data\Default\Preferences"
if ((Test-Path -Path $file -PathType Leaf)) {
$pref = Get-Content $file
if ($pref.IndexOf('"exit_type":"Crashed"') -gt 0) {
Write-Host "Change Edge exit_type from Crashed to Normal"
$pref.Replace('"exit_type":"Crashed"', '"exit_type":"Normal"') | Set-Content $file -NoNewLine
}
elseif ($pref.IndexOf('"exit_type":"SessionEnd"') -gt 0) {
Write-Host "Change Edge exit_type from SessionEnd to Normal"
$pref.Replace('"exit_type":"SessionEnd"', '"exit_type":"Normal"') | Set-Content $file -NoNewLine
}
}
else {
Write-Host "Fila eksisterer ikke:`n $file"
}