# Define the list of target computers
$targetComputers = @("QER-SS2301-OWS1", "QER-ELE-HI-FES2")
# Define the list of applications to uninstall
$appNames = @("[Link]", "[Link]",
"[Link]", "[Link]",
"[Link]", "[Link]", "[Link]",
"[Link]", "[Link]",
"[Link]", "[Link]",
"[Link]", "[Link]", "[Link]",
"[Link]", "MicrosoftTeams", "[Link]",
"[Link]", "[Link]",
"[Link]", "[Link]", "[Link]",
"[Link]", "[Link]",
"Microsoft.549981C3F5F10", "[Link]",
"[Link]", "[Link]")
# 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 $[Link]
}
}
# Create the marker file to indicate the script has run
New-Item -Path $markerFilePath -ItemType File
}