Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call PowerShell From WinRT App

I was wondering if there is a way to execute PowerShell scripts from WinRT apps. Specifically, I'd like to call Hyper-V cmdlets such as Get-VM and display the results in the Metro new Windows UI.

Or is there any other idea how to accomplish that? I've seen the Hyper-V Manager app on the Windows Store, does anybody happen to know how these guys do it? Thanks.

like image 529
Fichtenelch Avatar asked Mar 10 '26 05:03

Fichtenelch


1 Answers

I'm pretty sure there isn't a direct way in code to do this i.e. you can't host the PowerShell engine. However, if you are industrious, you could use WinRT socket support to either connect to a PowerShell Web Access port or a PowerShell remoting endpoint. Although the latter would likely take some heavy lifting to figure out the WSMan protocol.

like image 171
Keith Hill Avatar answered Mar 12 '26 21:03

Keith Hill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!