PowerShell SDK support for MAUI #20840
Replies: 4 comments 6 replies
-
I've successfully compiled PowerShell 7.0 to WebAssembly on the Mono runtime and tested an application on Android back then. However, the challenge extends beyond mere compilation. The core issue lies in the absence of a robust application model for PowerShell. While traces exist in PSISE, the non-open-source code, which includes fragments of Visual Studio, complicates adaptation to modern UI standards in 2023. One potential approach involves revisiting concepts from PSISE, such as those utilized with $PSISE, and aligning them with contemporary UI practices. A promising solution could be leveraging Avalonia UI, which offers clarity compared to the array of UI technologies Microsoft has introduced (WinForms, WPF, UWP, etc.). Microsoft appears entangled in a myriad of solutions, including attempts to integrate different UI hosting generations, leading to a convoluted mix of technologies. Personally, I've disengaged from keeping up with these developments. On the contrary, Avalonia is relatively new but based on WPF, benefiting from community feedback on application modeling. I'm anticipating that DotNet 9.0 will address multithreading challenges in WebAssembly, potentially paving the way for a cross-platform Avalonia framework supporting Windows/Linux/MacOS/Android/Browser. However, it's worth noting that accessing modules on Android and Browser platforms without requiring recompilation poses a significant hurdle, as PowerShell currently lacks application-oriented modules for these platforms, necessitating extensive development efforts. |
Beta Was this translation helpful? Give feedback.
-
When I think of the PowerShell SDK I am not thinking in terms of UI at all. What I am looking for is can I create an InitialSessionState, call PowerShell.Create(initialState) and then call Invoke on the powershell object itself. So can I use the SDK in a MAUI application so that I can implement parts of the application logic using PowerShell, I would not dream of producing an Android app where I was expecting the user to write PowerShell. |
Beta Was this translation helpful? Give feedback.
-
To clarify, I see PowerShell as a powerful scripting engine and I can see plenty of benefits writing pipelines to perform sequenced actions and workflow within the app, but that is just internal implementation, the mobile user does not need to know or care. Just like the user of a mobile app does not care if it is written in Java, Kotlin, React-Native, C#, Swift or objective-C. To them it is just an app. In exactly the same way, I could write web-services in PowerShell, but the person using a web-browser would have no idea. |
Beta Was this translation helpful? Give feedback.
-
Yes, I am deliberately thinking about the Sandboxed world on Android and iPhone. The end user expects apps to be self-contained and restricted by those operating systems and that they remain in control over the app's permissions. |
Beta Was this translation helpful? Give feedback.
-
Can the PowerShell SDK be used with MAUI?
#17941
The discussion was around supporting Android. Given MAUI is already doing Android then fitting in with this runtime would be better than having multiple PowerShell solutions for Android.
There are a few issues, from the documents it looks like MAUI is based on Mono Runtime rather than .NET CoreCLR.
Beta Was this translation helpful? Give feedback.
All reactions