# Step 1: Enable the Application Identity service (required for AppLocker)
Set-Service -Name AppIDSvc -StartupType Automatic
Start-Service -Name AppIDSvc -ErrorAction SilentlyContinue
$svc = Get-Service AppIDSvc
Write-Output "AppIDSvc: Status=$($svc.Status) StartType=$($svc.StartType)"

# Get publisher info for apps we want to deny
$deny = @('4DF9E0F8.Netflix','Microsoft.WindowsCamera','Microsoft.GamingApp','Microsoft.XboxApp',
'Microsoft.XboxGameOverlay','Microsoft.XboxGamingOverlay','Microsoft.Xbox.TCUI',
'Microsoft.XboxIdentityProvider','Microsoft.XboxSpeechToTextOverlay','Microsoft.ZuneVideo',
'Microsoft.WindowsMaps','Microsoft.YourPhone','Microsoft.SkypeApp','Microsoft.People',
'Microsoft.Messaging','Microsoft.MixedReality.Portal','Microsoft.Microsoft3DViewer',
'Microsoft.Copilot','Microsoft.WindowsTerminal','Microsoft.Edge.GameAssist',
'Microsoft.Getstarted','Microsoft.OneConnect','Microsoft.Windows.Photos','Microsoft.MSPaint',
'Microsoft.Print3D','SpotifyAB.SpotifyMusic','Evernote.Evernote','C27EB4BA.DropboxOEM',
'7EE7776C.LinkedInforWindows','AcerIncorporated.AcerCareCenterS',
'AcerIncorporated.AcerCollectionS','AcerIncorporated.AcerRegistration')

Write-Output ""
Write-Output "=== Publisher info for deny list ==="
foreach ($name in $deny) {
    $pkg = Get-AppxPackage -AllUsers -Name $name -ErrorAction SilentlyContinue | Select-Object -First 1
    if ($pkg) {
        Write-Output "$name|$($pkg.Publisher)|$($pkg.PackageFamilyName)"
    } else {
        Write-Output "$name|NOT_INSTALLED|"
    }
}
