

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.
#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.

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. Remove-Item -Path "C:\printer" -Recurse -Force` Which of the two is better It depends on the software you want to uninstall. 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." Write-Output "Dieses Programm muss als Administrator ausgeführt werden. $IsAdmin = ( ::GetCurrent()).IsInRole( "Administrator") I have the following Powershell script: # Check if the script is running as admin
