uwp - 使用 FullTrustProcessLauncher 类从 UWP 应用启动 powershell 脚本

标签 uwp desktop-bridge

有没有办法从我的 UWP 应用程序启动 powershell 脚本?

我读过我们必须使用 FullTrustProcessLauncher 类,但我不明白如何使用/实现它。

你有什么主意吗 ?

最佳答案

文档:https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.FullTrustProcessLauncher

sample :
https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/AppServiceBridgeSample

https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/JourneyAcrossTheBridge/DesktopBridgeDemo%20-%20Step4/MyUWPApp

https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/SQLServer

简而言之,这是您需要做的:

1) 添加对桌面扩展 SDK 的引用

2) 在 list 中声明 windows.FullTrustProcess 扩展

3)(可选)声明一个应用服务,用于在你的 UWP 和完全信任进程之间进行通信

4) 在你的包中包含一个 Win32 EXE,它将从 FullTrustProcessLauncher API 启动

5)Win32 EXE现在可以调用你的powershell等。

关于uwp - 使用 FullTrustProcessLauncher 类从 UWP 应用启动 powershell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44157327/

相关文章:

javascript - 渐进式WA : Why navigation to a URI only works when the the URI is registered in the manifest of the PWA

uwp - 使用 uwp 应用程序打开任何类型的文件(无文件关联)

electron - 将使用 Electron 构建的 APPX 发布到 Windows Store 和 Desktop Bridge 程序

c# - 没有控制台窗口的 AppServiceBridge

javascript - 在WebView UWP中通过ID获取dom元素

javascript - 如何禁用 Webview 滚动并设置其高度以适合整个内容

c# - xaml c# 中的可观察集合静态资源

c# - UWP - 以编程方式在 ItemTemplate 中显示进度条

uwp - 如何确定 AppService 何时因 UWP 应用挂起或完全信任进程关闭而关闭?