2013-07-23 20 views
0

我想列出安装在Windows 8机器上的所有Modern UI应用程序。如何列出所有现代UI应用程序?

是否有办法从标准桌面应用程序(具有管理员权限)列出所有已安装的Modern UI应用程序。

+0

所有现代的UI应用程序似乎在注册表中的“HKEY_CURRENT_USER \\ SOFTWARE \\类”,以“应用程序*”开始下注册。其中“/ Application/ApplicationName”是应用程序的名称,“/ Application/AppUserModelID”是唯一的ID。 – Friedrich

回答

0

奈杰尔有正确的答案;)

这是一个具有管理员权限自动启动补充: (我用这一招几个一个月前,所以我没有任何更长的来源。我会编辑这个职位,如果我发现了它。)

# Get the ID and security principal of the current user account 
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() 
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) 

# Get the security principal for the Administrator role 
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator 

# Check to see if we are currently running "as Administrator" 
if ($myWindowsPrincipal.IsInRole($adminRole)) 
{ 
    # We are running "as Administrator" - so change the title and background color to indicate this 
    $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)" 
    $Host.UI.RawUI.BackgroundColor = "DarkBlue" 
    clear-host 
} 
else 
{ 
    # We are not running "as Administrator" - so relaunch as administrator 

    # Create a new process object that starts PowerShell 
    $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; 

    # Specify the current script path and name as a parameter 
    $newProcess.Arguments = $myInvocation.MyCommand.Definition; 

    # Indicate that the process should be elevated 
    $newProcess.Verb = "runas"; 

    # Start the new process 
    [System.Diagnostics.Process]::Start($newProcess); 

    # Exit from the current, unelevated, process 
    exit 
} 

# List all apps 
Get-AppxPackage -AllUsers 
相关问题