# Define the list of target computers
$targetComputers = @("QER-SS2301-OWS1", "QER-ELE-HI-FES2")
# Define the list of applications to uninstall
$appNames = @("Microsoft.ZuneMusic", "Microsoft.ZuneVideo",
"Microsoft.XboxSpeechToTextOverlay", "Microsoft.XboxGamingOverlay",
"Microsoft.XboxGameOverlay", "Microsoft.Xbox.TCUI", "Microsoft.WindowsFeedbackHub",
"Microsoft.WindowsCamera", "Microsoft.People",
"Microsoft.MicrosoftSolitaireCollection", "Microsoft.GetHelp",
"Microsoft.GamingApp", "Microsoft.BingWeather", "Microsoft.BingNews",
"Clipchamp.Clipchamp", "MicrosoftTeams", "Microsoft.WindowsAlarms",
"Microsoft.OneDriveSync", "Microsoft.XboxIdentityProvider",
"Microsoft.WindowsMaps", "Microsoft.YourPhone", "Microsoft.PowerAutomateDesktop",
"Microsoft.Getstarted", "Microsoft.WindowsSoundRecorder",
"Microsoft.549981C3F5F10", "Microsoft.WindowsStore",
"microsoft.windowscommunicationsapps", "Microsoft.Todos")
# Define the path for the marker file
$markerFilePath = "$env:USERPROFILE\first_login_marker.txt"
# Get the current computer name
$currentComputer = $env:COMPUTERNAME
# Check if the current computer is in the list of target computers
if ($targetComputers -contains $currentComputer) {
# Check if the marker file exists
if (-Not (Test-Path -Path $markerFilePath)) {
foreach ($appName in $appNames) {
$app = Get-AppxPackage -Name $appName
if ($app) {
Remove-AppxPackage -Package $app.PackageFullName
}
}
# Create the marker file to indicate the script has run
New-Item -Path $markerFilePath -ItemType File
}