I am trying to launch a simple command using powershell within a UWP app. I am hitting a brick wall and have done the following:
In my Package Manifest file I have put the following:
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="powershell.exe">
I then created a group id:
<desktop:ParameterGroup GroupId="RestartPC" Parameters="Restart-Computer"/>
In my MainPage.xaml.cs I put the following:
string commandID = "RestartPC";
IAsyncAction operation = FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(commandID);
When I launch the app , the powershell window pops up for a second and then closes but nothing happens.
Any help would be appreciated. I looked at this thread for clues but it does not seem to make any difference.