Closed cjastone closed 6 years ago
In the most recent revision, the following line was removed:
Add-Type -AssemblyName PresentationCore,PresentationFramework
Unfortunately, this breaks WPF, meaning the script does nothing now! If I remove this line:
$ErrorActionPreference = 'silentlycontinue'
...the script produces a number of errors:
Unable to find type [Windows.MessageBoxButton]. At C:\Scripts\Windows10Debloater\Windows10Debloater.ps1:488 char:11 + $Button = [Windows.MessageBoxButton]::YesNoCancel + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Windows.MessageBoxButton:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound Unable to find type [Windows.MessageBoxImage]. At C:\Scripts\Windows10Debloater\Windows10Debloater.ps1:489 char:13 + $ErrorIco = [Windows.MessageBoxImage]::Error + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Windows.MessageBoxImage:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound Unable to find type [Windows.MessageBoxImage]. At C:\Scripts\Windows10Debloater\Windows10Debloater.ps1:490 char:9 + $Warn = [Windows.MessageBoxImage]::Warning + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Windows.MessageBoxImage:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound Unable to find type [Windows.MessageBox]. At C:\Scripts\Windows10Debloater\Windows10Debloater.ps1:503 char:12 + $Prompt1 = [Windows.MessageBox]::Show($Ask,"Debloat or Revert",$Butto ... + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Windows.MessageBox:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound
Reinserting the Add-Type -AssemblyName PresentationCore,PresentationFramework resolves this issue.
Otherwise a great script - keep up the top work!
Wow! Thanks for catching that. I added it back in.
In the most recent revision, the following line was removed:
Add-Type -AssemblyName PresentationCore,PresentationFramework
Unfortunately, this breaks WPF, meaning the script does nothing now! If I remove this line:
$ErrorActionPreference = 'silentlycontinue'
...the script produces a number of errors:
Reinserting the
Add-Type -AssemblyName PresentationCore,PresentationFramework
resolves this issue.Otherwise a great script - keep up the top work!