Do you get an error attempting to create a XAML app referencing
System.Management.Automation (which you need for PowerShell much like is described as in this link)? You also tried adding it in via the Add>Reference… option from within the Solution Explorer which only seems to have
Install the NuGet package and reference it in your project.
1 – Save your XAML Project and close it.
2 – Using your favorite text editor, open the <MyXAMLApp>.csproj file and add the reference manually with:
<Reference Include=”System.Management.Automation” />