powershell - 如何在 Windows 10 中从 PowerShell 启动通用 Windows 应用程序 (UWP)?

标签 powershell uwp

在 PowerShell 中,如果我运行 获取-AppxPackage , 我得到了安装的 UWP 应用程序列表,包括我的。
例如:

Name              : TonyHenrique.tonyuwpteste
Publisher         : CN=tTony
Architecture      : X64
ResourceId        :
Version           : 1.1.12.0
PackageFullName   : TonyHenrique.tonyuwpteste_1.1.12.0_x64__h3h3tmhvy8gfc
InstallLocation   : C:\Program Files\WindowsApps\TonyHenrique.tonyuwpteste_1.1.12.0_x64__h3h3tmhvy8gfc
IsFramework       : False
PackageFamilyName : TonyHenrique.tonyuwpteste_h3h3tmhvy8gfc
PublisherId       : h3h3tmhvy8gfc
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
Dependencies      : {Microsoft.NET.CoreRuntime.2.1_2.1.25801.2_x64__8wekyb3d8bbwe, Microsoft.VCLibs.140.00.Debug_14.0.25805.1_x64__8wekyb3d8bbwe,
                    TonyHenrique.tonyuwpteste_1.1.12.0_neutral_split.scale-100_h3h3tmhvy8gfc}
IsPartiallyStaged : False
SignatureKind     : Developer
Status            : Ok

现在我想启动这个应用程序。

如何在 中执行此操作PowerShell ,或在 cmd ?

最佳答案

在开发过程中,我遇到过应用系列名称偶尔会更改的情况。您可以通过简单的查找按名称可靠地启动应用程序:

  • 命令
    powershell.exe explorer.exe shell:AppsFolder\$(get-appxpackage -name YourAppName ^| select -expandproperty PackageFamilyName)!App
    
  • 电源 shell
    explorer.exe shell:AppsFolder\$(get-appxpackage -name YourAppName | select -expandproperty PackageFamilyName)!App
    
  • 关于powershell - 如何在 Windows 10 中从 PowerShell 启动通用 Windows 应用程序 (UWP)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46893260/

    相关文章:

    windows - 通用 Windows 平台/UAP : what is AOT?

    UWP:在 DataTemplate 上使用 x:DataType 属性时编译错误

    mvvm - 绑定(bind)到 UWP 数据网格的动态列数(Windows 社区工具包)

    c# - HttpClient 在上传前读取整个文件。 UWP

    c# - 使用自己的 PowerShell CmdLets 将管理命令发送到我的 C# Windows 服务

    file - 这个powershell脚本是找到所有者然后更改所有者的好方法吗

    json - Power shell 脚本在 Windows powershell ISE 中运行良好,但在 Power shell 版本 5 中不起作用

    windows - Powershell脚本无法读取AD电话号码

    powershell - 使用 SAS token 上传 Blob 内容

    c# - 连接到 VPN 会停止 UWP 应用程序互联网通信