読者です 読者をやめる 読者になる 読者になる

Windows 10 ユニバーサルWindowsプラットフォームアプリケーションの一覧を表示名込みで取得するPowerShellスクリプト

Get-AppxPackageだとどのアプリかよくわからないので表示名を取得するスクリプトを作りました。


$MrtCacheTable = @()

Get-Item -Path "HKCU:\Software\Classes\Local Settings\MrtCache" | Get-ChildItem | ForEach {
    Get-Item -Path ("Registry::" + $_.Name) | Get-ChildItem | ForEach {
        Get-Item -Path ("Registry::" + $_.Name) | Get-ChildItem | ForEach {
            $MrtCacheKey = (Get-Item -Path ("Registry::" + $_))
            $MrtCacheKey.GetValueNames() | ForEach {
                $MrtCacheRecord = "" | Select Name, Value, Path, LanguageList
                $MrtCacheRecord.Name = $_
                $MrtCacheRecord.Value = $MrtCacheKey.GetValue($_)
                $MrtCacheRecord.Path = $MrtCacheKey.Name
                $MrtCacheRecord.LanguageList = $MrtCacheKey.GetValue("LanguageList")
                $MrtCacheTable += $MrtCacheRecord
            }
        }
    }
} 

#$MrtCacheTable | Format-Table -AutoSize

$PackagesTable = @()

Get-Item -Path "HKCU:\Software\Classes\Extensions\ContractId\Windows.Launch\PackageId" | Get-ChildItem | ForEach {
    $PackageId = (Split-Path $_.Name -Leaf)
    Get-Item -Path ("Registry::" + $_.Name) | Get-ChildItem | ForEach {
        Get-Item -Path ("Registry::" + $_.Name) | Get-ChildItem | ForEach {
            $PackageIdKey = (Get-Item -Path ("Registry::" + $_))
            $PackageIdRecord = "" | Select PackageId, DisplayName
            $PackageIdRecord.PackageId = $PackageId
            $DisplayName = $PackageIdKey.GetValue("DisplayName")

            if ($DisplayName -notlike "@{*"){
                $PackageIdRecord.DisplayName = $DisplayName
            }
            else{
                $NewDisplayName = ($MrtCacheTable | Where {($_.LanguageList -like "*ja*") -and ($_.Name -eq $DisplayName)}).Value
                if ($NewDisplayName -notlike ""){
                    $PackageIdRecord.DisplayName = $NewDisplayName
                }
                else{
                    #$PackageIdRecord.DisplayName = $DisplayName
                    $PackageIdRecord.DisplayName = ""
                }
            }

            $PackagesTable += $PackageIdRecord
        }
    }
} 

##$PackagesTable

$AppxPackageTable = @()

Get-AppxPackage | Where IsFramework -eq $False  | ForEach {
    $AppxPackageRecord = "" | Select DisplayName, PackageFamilyName, PackageFullName
    $AppxPackageRecord.DisplayName = ($PackagesTable | Where PackageId -eq $_.PackageFullName).DisplayName
    $AppxPackageRecord.PackageFamilyName = $_.PackageFamilyName
    $AppxPackageRecord.PackageFullName = $_.PackageFullName
    $AppxPackageTable += $AppxPackageRecord
}

$AppxPackageTable | Sort DisplayName | Out-GridView

取得結果

f:id:morokoshidog:20170423150856p:plain

DisplayName                                      PackageFamilyName                                         PackageFullName                                                                     
-----------                                      -----------------                                         ---------------                                                                     
職場または学校アカウント                                     Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy                  Microsoft.AAD.BrokerPlugin_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy             
Microsoft アカウント                                  Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy       Microsoft.Windows.CloudExperienceHost_10.0.15063.0_neutral_neutral_cw5n1h2txyewy    
                                                 Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy       Microsoft.Windows.ShellExperienceHost_10.0.15063.0_neutral_neutral_cw5n1h2txyewy    
設定                                               windows.immersivecontrolpanel_cw5n1h2txyewy               windows.immersivecontrolpanel_6.2.0.0_neutral_neutral_cw5n1h2txyewy                 
{Cortana, }                                      Microsoft.Windows.Cortana_cw5n1h2txyewy                   Microsoft.Windows.Cortana_1.8.12.15063_neutral_neutral_cw5n1h2txyewy                
{Microsoft Edge, Microsoft Edge, Microsoft Edge} Microsoft.MicrosoftEdge_8wekyb3d8bbwe                     Microsoft.MicrosoftEdge_40.15063.0.0_neutral__8wekyb3d8bbwe                         
                                                 Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy    Microsoft.Windows.ContentDeliveryManager_10.0.15063.0_neutral_neutral_cw5n1h2txyewy 
                                                 Microsoft.VCLibs.140.00_8wekyb3d8bbwe                     Microsoft.VCLibs.140.00_14.0.24123.0_x64__8wekyb3d8bbwe                             
                                                 Microsoft.VCLibs.140.00_8wekyb3d8bbwe                     Microsoft.VCLibs.140.00_14.0.24123.0_x86__8wekyb3d8bbwe                             
                                                 Microsoft.NET.Native.Framework.1.3_8wekyb3d8bbwe          Microsoft.NET.Native.Framework.1.3_1.3.24201.0_x64__8wekyb3d8bbwe                   
                                                 Microsoft.NET.Native.Framework.1.3_8wekyb3d8bbwe          Microsoft.NET.Native.Framework.1.3_1.3.24201.0_x86__8wekyb3d8bbwe                   
                                                 Microsoft.NET.Native.Runtime.1.3_8wekyb3d8bbwe            Microsoft.NET.Native.Runtime.1.3_1.3.23901.0_x64__8wekyb3d8bbwe                     
                                                 Microsoft.NET.Native.Runtime.1.3_8wekyb3d8bbwe            Microsoft.NET.Native.Runtime.1.3_1.3.23901.0_x86__8wekyb3d8bbwe                     
{カレンダー, メール, メール/カレンダー アカウント}                    microsoft.windowscommunicationsapps_8wekyb3d8bbwe         microsoft.windowscommunicationsapps_17.8104.42387.0_x64__8wekyb3d8bbwe              
カメラ                                              Microsoft.WindowsCamera_8wekyb3d8bbwe                     Microsoft.WindowsCamera_2017.214.20.0_x64__8wekyb3d8bbwe                            
ストア                                              Microsoft.WindowsStore_8wekyb3d8bbwe                      Microsoft.WindowsStore_11701.1001.99.0_x64__8wekyb3d8bbwe                           
Xbox Identity Provider                           Microsoft.XboxIdentityProvider_8wekyb3d8bbwe              Microsoft.XboxIdentityProvider_11.19.19003.0_x64__8wekyb3d8bbwe                     
                                                 Microsoft.NET.Native.Runtime.1.4_8wekyb3d8bbwe            Microsoft.NET.Native.Runtime.1.4_1.4.24201.0_x64__8wekyb3d8bbwe                     
                                                 Microsoft.NET.Native.Runtime.1.4_8wekyb3d8bbwe            Microsoft.NET.Native.Runtime.1.4_1.4.24201.0_x86__8wekyb3d8bbwe                     
LINE                                             NAVER.LINEwin8_8ptj331gd3tyt                              NAVER.LINEwin8_5.4.8.0_x64__8ptj331gd3tyt                                           
                                                 Microsoft.XboxGameCallableUI_cw5n1h2txyewy                Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy           
Get Help                                         Windows.ContactSupport_cw5n1h2txyewy                      Windows.ContactSupport_10.0.15063.0_neutral_neutral_cw5n1h2txyewy                   
                                                 Windows.MiracastView_cw5n1h2txyewy                        Windows.MiracastView_6.3.0.0_neutral_neutral_cw5n1h2txyewy                          
                                                 EnvironmentsApp_cw5n1h2txyewy                             EnvironmentsApp_10.0.15063.0_neutral__cw5n1h2txyewy                                 
                                                 HoloCamera_cw5n1h2txyewy                                  HoloCamera_1.0.0.5_neutral__cw5n1h2txyewy                                           
                                                 HoloItemPlayerApp_cw5n1h2txyewy                           HoloItemPlayerApp_1.0.0.2_neutral__cw5n1h2txyewy                                    
                                                 HoloShell_cw5n1h2txyewy                                   HoloShell_10.0.15063.0_neutral__cw5n1h2txyewy                                       
                                                 Microsoft.AccountsControl_cw5n1h2txyewy                   Microsoft.AccountsControl_10.0.15063.0_neutral__cw5n1h2txyewy                       
                                                 Microsoft.BioEnrollment_cw5n1h2txyewy                     Microsoft.BioEnrollment_10.0.15063.0_neutral__cw5n1h2txyewy                         
                                                 Microsoft.CredDialogHost_cw5n1h2txyewy                    Microsoft.CredDialogHost_10.0.15063.0_neutral__cw5n1h2txyewy                        
                                                 E2A4F912-2574-4A75-9BB0-0D023378592B_cw5n1h2txyewy        E2A4F912-2574-4A75-9BB0-0D023378592B_10.0.15063.0_neutral_neutral_cw5n1h2txyewy     
                                                 Microsoft.LockApp_cw5n1h2txyewy                           Microsoft.LockApp_10.0.15063.0_neutral__cw5n1h2txyewy                               
接続                                               Microsoft.PPIProjection_cw5n1h2txyewy                     Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy                  
                                                 Microsoft.Windows.Apprep.ChxApp_cw5n1h2txyewy             Microsoft.Windows.Apprep.ChxApp_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy        
                                                 Microsoft.Windows.AssignedAccessLockApp_cw5n1h2txyewy     Microsoft.Windows.AssignedAccessLockApp_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy
複合現実ポータル                                         Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy       Microsoft.Windows.HolographicFirstRun_10.0.15063.0_neutral_neutral_cw5n1h2txyewy    
                                                 1527c705-839a-4832-9118-54d4Bd6a0c89_cw5n1h2txyewy        1527c705-839a-4832-9118-54d4Bd6a0c89_10.0.15063.0_neutral_neutral_cw5n1h2txyewy     
エクスプローラー                                         c5e2524a-ea46-4f67-841f-6a9465d9d515_cw5n1h2txyewy        c5e2524a-ea46-4f67-841f-6a9465d9d515_10.0.15063.0_neutral_neutral_cw5n1h2txyewy     
                                                 CortanaListenUIApp_cw5n1h2txyewy                          CortanaListenUIApp_10.0.15063.0_neutral__cw5n1h2txyewy                              
                                                 DesktopLearning_cw5n1h2txyewy                             DesktopLearning_1000.15063.0.0_neutral__cw5n1h2txyewy                               
                                                 DesktopView_cw5n1h2txyewy                                 DesktopView_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy                            
                                                 Microsoft.Windows.ModalSharePickerHost_cw5n1h2txyewy      Microsoft.Windows.ModalSharePickerHost_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy 
                                                 Microsoft.Windows.OOBENetworkCaptivePortal_cw5n1h2txyewy  Microsoft.Windows.OOBENetworkCaptivePortal_10.0.15063.0_neutral__cw5n1h2txyewy      
                                                 Microsoft.Windows.OOBENetworkConnectionFlow_cw5n1h2txyewy Microsoft.Windows.OOBENetworkConnectionFlow_10.0.15063.0_neutral__cw5n1h2txyewy     
                                                 Microsoft.Windows.ParentalControls_cw5n1h2txyewy          Microsoft.Windows.ParentalControls_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy     
                                                 Windows.PrintDialog_cw5n1h2txyewy                         Windows.PrintDialog_6.2.0.0_neutral_neutral_cw5n1h2txyewy                           
WindowPicker                                     Microsoft.Windows.WindowPicker_cw5n1h2txyewy              Microsoft.Windows.WindowPicker_10.0.15063.0_neutral__cw5n1h2txyewy                  
                                                 Microsoft.Windows.SecureAssessmentBrowser_cw5n1h2txyewy   Microsoft.Windows.SecureAssessmentBrowser_10.0.15063.0_neutral_neutral_cw5n1h2txyewy
SecondaryTileExperience                          Microsoft.Windows.SecondaryTileExperience_cw5n1h2txyewy   Microsoft.Windows.SecondaryTileExperience_10.0.0.0_neutral__cw5n1h2txyewy           
Windows Defender セキュリティ センター                     Microsoft.Windows.SecHealthUI_cw5n1h2txyewy               Microsoft.Windows.SecHealthUI_10.0.15063.0_neutral__cw5n1h2txyewy                   
アラーム & クロック                                      Microsoft.WindowsAlarms_8wekyb3d8bbwe                     Microsoft.WindowsAlarms_10.1703.602.0_x64__8wekyb3d8bbwe                            
Skype                                            Microsoft.SkypeApp_kzf8qxf38zg5c                          Microsoft.SkypeApp_11.13.133.0_x64__kzf8qxf38zg5c                                   
{映画 & テレビ, Movies & TV}                          Microsoft.ZuneVideo_8wekyb3d8bbwe                         Microsoft.ZuneVideo_10.17022.10311.0_x64__8wekyb3d8bbwe                             
Groove ミュージック                                    Microsoft.ZuneMusic_8wekyb3d8bbwe                         Microsoft.ZuneMusic_10.17022.10301.0_x64__8wekyb3d8bbwe                             
                                                 Microsoft.XboxSpeechToTextOverlay_8wekyb3d8bbwe           Microsoft.XboxSpeechToTextOverlay_1.14.2002.0_x64__8wekyb3d8bbwe                    
Xbox Game bar                                    Microsoft.XboxGameOverlay_8wekyb3d8bbwe                   Microsoft.XboxGameOverlay_1.15.29002.0_x64__8wekyb3d8bbwe                           
Xbox                                             Microsoft.XboxApp_8wekyb3d8bbwe                           Microsoft.XboxApp_27.28.8007.0_x64__8wekyb3d8bbwe                                   
ボイス レコーダー                                        Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe              Microsoft.WindowsSoundRecorder_10.1703.601.0_x64__8wekyb3d8bbwe                     
マップ                                              Microsoft.WindowsMaps_8wekyb3d8bbwe                       Microsoft.WindowsMaps_5.1703.762.0_x64__8wekyb3d8bbwe                               
フィードバック Hub                                      Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe                Microsoft.WindowsFeedbackHub_1.1703.971.0_x64__8wekyb3d8bbwe                        
電卓                                               Microsoft.WindowsCalculator_8wekyb3d8bbwe                 Microsoft.WindowsCalculator_10.1703.601.0_x64__8wekyb3d8bbwe                        
Microsoft Wallet                                 Microsoft.Wallet_8wekyb3d8bbwe                            Microsoft.Wallet_1.0.16328.0_x64__8wekyb3d8bbwe                                     
Store Purchase App                               Microsoft.StorePurchaseApp_8wekyb3d8bbwe                  Microsoft.StorePurchaseApp_11608.1000.2431.0_x64__8wekyb3d8bbwe                     
People                                           Microsoft.People_8wekyb3d8bbwe                            Microsoft.People_10.2.831.0_x64__8wekyb3d8bbwe                                      
有料 Wi-Fi & 携帯ネットワーク                              Microsoft.OneConnect_8wekyb3d8bbwe                        Microsoft.OneConnect_2.1704.952.0_x64__8wekyb3d8bbwe                                
OneNote                                          Microsoft.Office.OneNote_8wekyb3d8bbwe                    Microsoft.Office.OneNote_17.8067.57631.0_x64__8wekyb3d8bbwe                         
ペイント 3D                                          Microsoft.MSPaint_8wekyb3d8bbwe                           Microsoft.MSPaint_2.1703.21017.0_x64__8wekyb3d8bbwe                                 
Sticky Notes                                     Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe              Microsoft.MicrosoftStickyNotes_1.8.0.0_x64__8wekyb3d8bbwe                           
                                                 Microsoft.Advertising.Xaml_8wekyb3d8bbwe                  Microsoft.Advertising.Xaml_10.1704.1.0_x64__8wekyb3d8bbwe                           
                                                 Microsoft.Advertising.Xaml_8wekyb3d8bbwe                  Microsoft.Advertising.Xaml_10.1704.1.0_x86__8wekyb3d8bbwe                           
                                                 Microsoft.Services.Store.Engagement_8wekyb3d8bbwe         Microsoft.Services.Store.Engagement_10.0.1610.0_x64__8wekyb3d8bbwe                  
                                                 Microsoft.Services.Store.Engagement_8wekyb3d8bbwe         Microsoft.Services.Store.Engagement_10.0.1610.0_x86__8wekyb3d8bbwe                  
Microsoft Solitaire Collection                   Microsoft.MicrosoftSolitaireCollection_8wekyb3d8bbwe      Microsoft.MicrosoftSolitaireCollection_3.16.3302.0_x64__8wekyb3d8bbwe               
                                                 Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe                Microsoft.MicrosoftOfficeHub_17.8107.7600.0_x64__8wekyb3d8bbwe                      
View 3D                                          Microsoft.Microsoft3DViewer_8wekyb3d8bbwe                 Microsoft.Microsoft3DViewer_1.1703.13029.0_x64__8wekyb3d8bbwe                       
                                                 Microsoft.Messaging_8wekyb3d8bbwe                         Microsoft.Messaging_3.26.24002.0_x64__8wekyb3d8bbwe                                 
ヒント                                              Microsoft.Getstarted_8wekyb3d8bbwe                        Microsoft.Getstarted_5.0.13.0_x64__8wekyb3d8bbwe                                    
                                                 Microsoft.DesktopAppInstaller_8wekyb3d8bbwe               Microsoft.DesktopAppInstaller_1.0.10332.0_x64__8wekyb3d8bbwe                        
天気                                               Microsoft.BingWeather_8wekyb3d8bbwe                       Microsoft.BingWeather_4.20.1102.0_x64__8wekyb3d8bbwe                                
3D Builder                                       Microsoft.3DBuilder_8wekyb3d8bbwe                         Microsoft.3DBuilder_14.0.1031.0_x64__8wekyb3d8bbwe                                  
{フォト, フォト}                                       Microsoft.Windows.Photos_8wekyb3d8bbwe                    Microsoft.Windows.Photos_17.313.10010.0_x64__8wekyb3d8bbwe