gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:51:29 26 4
gpt4 key购买 nike

有没有办法从我的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com