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