Created
November 21, 2018 01:20
-
-
Save rido-min/00ef44701e4420ca0ef8aec32332d88d to your computer and use it in GitHub Desktop.
ActivateAppx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-Locally { | |
param( | |
[Parameter(Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)] | |
[string] $ID <# package.appxmanifest//Identity@name #> | |
) | |
$package = Get-AppxPackage $ID | |
$manifest = Get-appxpackagemanifest $package | |
$applicationUserModelId = $package.PackageFamilyName + "!" + $manifest.package.applications.application.id | |
Write-Host "ActivateApplication: " $applicationUserModelId | |
add-type -TypeDefinition $code | |
$appActivator = new-object StoreAppRunner.ApplicationActivationManager | |
$appActivator.ActivateApplication($applicationUserModelId,$null,[StoreAppRunner.ActivateOptions]::None,[ref]0) | Out-Null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment