'Suppress error Powershell not catching additional error when opening a WPF application

I'm trying to write 'Windows Powershell' command to simply open an application (DaxStudio).

These are the options I've tried:

Start-Process "c:\Program Files\DAX Studio\DaxStudio.exe"

Start-Process 'c:\Program Files\DAX Studio\DaxStudio.exe' -ErrorAction SilentlyContinue

Start-Process 'c:\Program Files\DAX Studio\DaxStudio.exe' Out-Null

$null = Start-Process 'c:\Program Files\DAX Studio\DaxStudio.exe'

[void]::(Start-Process 'c:\Program Files\DAX Studio\DaxStudio.exe')

All of the commands initially open the application as expected, which is great, but then a further prompt appears in PowerShell with this error message:

Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
   at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
   at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
   at System.Windows.ResourceDictionary.set_Source(Uri value)
   at MLib.Internal.AppearanceManagerImpl.SetThemeSourceAndAccentColor(List`1 sources, Color accentColor)

How do I suppress this additional prompt and error?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source