mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-21 23:43:25 +01:00
Rename to windefender.ps1
This commit is contained in:
parent
020e1fa30b
commit
b1845110bb
@ -88,7 +88,7 @@ Mega Collection of PowerShell Scripts
|
||||
| [restart-network-adapters.ps1](scripts/restart-network-adapters.ps1) | Restarts all local network adapters. [Read more...](docs/restart-network-adapters.md)|
|
||||
| [upgrade-ubuntu.ps1](scripts/upgrade-ubuntu.ps1) | Upgrades Ubuntu Linux to the latest (LTS) release. [Read more...](docs/upgrade-ubuntu.md) |
|
||||
| [wake-up.ps1](scripts/wake-up.ps1) | Wakes up a computer using Wake-on-LAN. [Read more...](docs/wakeup.md) |
|
||||
| [WinDefender.ps1](scripts/WinDefender.ps1) | Turn Windows Defender on/off/check real time monitoring. [Read more...](docs/WinDefender.md) |
|
||||
| [windefender.ps1](scripts/windefender.ps1) | Turn Windows Defender on/off/check real time monitoring. [Read more...](docs/windefender.md) |
|
||||
|
||||
|
||||
💻 Scripts for the Desktop
|
||||
|
@ -1,66 +0,0 @@
|
||||
Windefender.ps1
|
||||
================
|
||||
|
||||
This PowerShell script check for windwos defender status and also turn off/on real time monitoring of windows defender.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./Windefender.ps1
|
||||
|
||||
```
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Windows defender in powershell
|
||||
.DESCRIPTION
|
||||
This script can enable disable and show windows defender real time monitoring!
|
||||
.EXAMPLE
|
||||
PS> ./Windefender.ps1
|
||||
.LINK
|
||||
https://github.com/pakoti/Awesome_Sysadmin
|
||||
.NOTES
|
||||
Author: Dark Master | License: CC0-1,0
|
||||
#>
|
||||
|
||||
|
||||
|
||||
$defender = Get-MpPreference
|
||||
|
||||
$userInput = Read-Host "Enter an option:
|
||||
[1] Disable real time monitoring
|
||||
[2] Enable real time monitoring
|
||||
[3] Check status
|
||||
"
|
||||
|
||||
switch($userInput) {
|
||||
1 {
|
||||
$defender.DisableRealtimeMonitoring = $true
|
||||
$defender | Set-MpPreference
|
||||
Write-Host "Real-time monitoring of Windows Defender has been disabled."
|
||||
break
|
||||
}
|
||||
2 {
|
||||
$defender.DisableRealtimeMonitoring = $false
|
||||
$defender | Set-MpPreference
|
||||
Write-Host "Real-time monitoring of Windows Defender has been enabled."
|
||||
break
|
||||
}
|
||||
3 {
|
||||
if($defender.DisableRealtimeMonitoring) {
|
||||
Write-Host "Real-time monitoring of Windows Defender is currently disabled."
|
||||
} else {
|
||||
Write-Host "Real-time monitoring of Windows Defender is currently enabled."
|
||||
}
|
||||
break
|
||||
}
|
||||
default {
|
||||
Write-Host "Invalid option selected."
|
||||
break
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Windows defender in powershell
|
||||
Configure Windows defender
|
||||
.DESCRIPTION
|
||||
This script can enable disable and show windows defender real time monitoring!
|
||||
This script can enable / disable and show Windows defender real time monitoring!
|
||||
.EXAMPLE
|
||||
PS> ./Windefender.ps1
|
||||
PS> ./windefender.ps1
|
||||
.LINK
|
||||
https://github.com/pakoti/Awesome_Sysadmin
|
||||
.NOTES
|
||||
@ -46,4 +46,4 @@ default {
|
||||
Write-Host "Invalid option selected."
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user