0% found this document useful (0 votes)
36 views1 page

Uninstall Apps

Uploaded by

Muthu Pandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

Uninstall Apps

Uploaded by

Muthu Pandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# 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
}

You might also like