-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbotcleaner.ps1
45 lines (32 loc) · 2.33 KB
/
botcleaner.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<#
botcleaner.ps1
.DESCRIPTION
Script-Vorlage
https://github.com/thelamescriptkiddiemax/powershell
#>
#--- Variablen ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$scriptspeed = "2" # Darstellungsdauer der Textausgaben in Sekunden EX 2
#--- Vorbereitung -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$stringhost = [System.String]::Concat("[ ", $env:UserName, " @ ", $env:computername, " @ ", ((Get-WmiObject Win32_ComputerSystem).Domain), " ", (Get-CimInstance Win32_OperatingSystem | Select-Object Caption), ": ",
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" -Name ReleaseID).ReleaseId), " ] ", (Get-Date -Format "dd/MM/yyyy HH:mm:ss"), "`n", "[ ", $MyInvocation.MyCommand.Name, " ]", "`n","`n")
$stringhost = $stringhost.replace("{Caption=Microsoft"," ").replace("}", " ")
#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function waittimer {
Start-Sleep -Seconds $scriptspeed
}
#--- Verarbeitung -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Clear-Host
Write-Host $stringhost -ForegroundColor Magenta
Write-Host " Augenblick! Einmal kurz den Desktop desinfizieren..."
waittimer
Stop-Process -Name *Firefox*
Start-Sleep -Seconds 1
Stop-Process -Name *Excel*
Start-Sleep -Seconds 1
Stop-Process -Name *deepl*
Clear-Host
Write-Host $stringhost -ForegroundColor Magenta
Write-Host " Alles klar, es kann weiter gehen..."
waittimer
#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stop-process -Id $PID # Shell schliessen