Virtual Remote Networking

PowerShell – Useful scripts

PowerShell – Useful scripts-

Here are some scripts which I used over the period of time just as a quick copy/paste to perform a few basic tasks.

  1. Installation of the application with silent parameters using PDQ Deploy. this will install Malwarebytes’ Anti-Malware very silent without any window and without a restart and will log the installation
mbam-setup-2.1.6.1022.exe /VERYSILENT /SUPPRESSMSGBOXES /NOCANCEL /NORESTART /SP- /LOG="%TEMP%\performancerestoration-1.1.log"

2-  This script will remove a particular folder, sub-folder, and files under a particular target path.

$users = Get-ChildItem \\192.168.0.4\c$\Users\
foreach ($user in $users){
$folder = “$($user.fullname)\AppData\Roaming\extvisual”
If (Test-Path $folder) {
Remove-Item $folder -Recurse -Force -ErrorAction silentlycontinue
}}

This is work in progress and I will keep adding more scripts as I keep testing more scripts.