14 lines
709 B
PowerShell
14 lines
709 B
PowerShell
[CmdletBinding()]
|
|
param()
|
|
$ErrorActionPreference = 'Stop'
|
|
$taskExpectedManifest = Join-Path $PSScriptRoot '.runtime\native-host.json'
|
|
foreach ($taskBrowser in @('Google\Chrome','Microsoft\Edge','Chromium')) {
|
|
$taskRegistryPath = "HKCU:\Software\$taskBrowser\NativeMessagingHosts\com.youtubedl.native"
|
|
if (Test-Path -LiteralPath $taskRegistryPath) {
|
|
$taskCurrentManifest = (Get-Item -LiteralPath $taskRegistryPath).GetValue('')
|
|
if ($taskCurrentManifest -eq $taskExpectedManifest) { Remove-Item -LiteralPath $taskRegistryPath }
|
|
}
|
|
}
|
|
Write-Host 'Native helper unregistered. Remove YouTubeDL from the browser extensions page.'
|
|
Write-Host 'Downloaded media files have not been removed.'
|