Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $AppName = "TikTok" # DisplayName in Add/Remove Programs
- # Gather all the apps in the Add/Remove Programs Registry Keys
- $Apps = (Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\) | Get-ItemProperty | Select-Object DisplayName, DisplayVersion, WindowsInstaller, SystemComponent
- $Apps += (Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\) | Get-ItemProperty | Select-Object DisplayName, DisplayVersion, WindowsInstaller, SystemComponent
- # Check is the App DisplayName is found
- $AppFound = $Apps | Where-Object {
- ($_.DisplayName -match $AppName)
- }
- # Post some output if the app is found
- if ($AppFound) {
- $TikTok = "Detected"
- } else {
- $TikTok = " NotDetected"
- }
- # Check the AppxPackages for the App
- $AppFound = Get-AppxPackage -AllUsers | Where-Object {$_.Name -like "BytedancePte.Ltd.TikTok" } | Select-Object Name
- if ($AppFound) {
- $TikTok = "Detected"
- } else {
- $TikTok = " NotDetected"
- }
- $hash = @{ TikTok = $TikTok}
- return $hash | Convertto-Json -Compress
Advertisement
Add Comment
Please, Sign In to add comment