
So here is the Question: How do I bring my little program to others from the school without it getting flagged? Maybe there is even a completely different approach than mine to the problem altogether. What I tried is converting it to an exe file using PS2EXE which worked but when others downloaded it, Windows blocked the download as it was identified as a virus. The problem now is that you cant really just share PowerShell scripts, because you'd have to change a policy to execute it (at least to my knowledge). So i created this script in which one only has to enter their own printer address provided by the school and the rest is done for them. Once you standardize on PowerShell 7 you can then remove or disable PowerShell 2 to better secure your network.
#How to remove windows powershell virus install
It is meant to install the printers for our school because at the moment the school's solution is to install is manually, but many people aren't tech savvy enough to do that, even with a step-by-step guide. Remove-Item -Path "C:\printer" -Recurse -Force` Remove-Item -Path "C:\printer.zip" -Force Pnputil.exe /add-driver "C:\printer\UPD4PCL6Win81P_2101MU\driver\圆4\PCL6\KOBxxK_01.inf" /installĪdd-PrinterDriver -Name “KONICA MINOLTA Universal V4 PCL”Īdd-Printer -PortName $PortName -DriverName "KONICA MINOLTA Universal V4 PCL" -Name "Printer" Invoke-WebRequest -Uri "" -OutFile "C:\printer.zip"Įxpand-Archive -Path "C:\printer.zip" -DestinationPath "C:\printerAksa" $PortName = Read-Host -Prompt "Gib deine Druckeradresse ein" Bitte Rechtsklicke diese datei und wähle 'Als Administrator' ausführen." What is Get-WmiObject Get-WmiObject uses the Windows Management Instrumentation (WMI) to get specific information about your device.


If PowerShell’s Get-WmiObject recognizes it, go with this option as it’s easier. Write-Output "Dieses Programm muss als Administrator ausgeführt werden. Which of the two is better It depends on the software you want to uninstall.

$IsAdmin = ( ::GetCurrent()).IsInRole( "Administrator") I have the following Powershell script: # Check if the script is running as admin
