type script.ps1 |powershell.exe -windowstyle hidden -noprofile –lub w pliku bat, abyśmy nie widzieli za dużo na ekranie:
@echo off ::run_ps_script.bat type script.ps1 |powershell.exe -windowstyle hidden -noprofile –Więcej informacji o wykonywaniu z pozoru niechcianego oprogramowania znajdziecie w moim kursie na Microsoft Virtual Academy – “Wykorzystanie narzędzi hackerskich do audytu środowiska informatycznego“.
Sometimes we have to run the PowerShell script despite the Execution Policy setting on Restricted (default). On the Internet, you will quickly find pages like “15 Ways to Bypass the PowerShell Execution Policy” but not all methods work. For me, one of the methods that are always working is to make:
type script.ps1 |powershell.exe -windowstyle hidden -noprofile –or in a bat file so that we do not see too much on the screen:
@echo off :: run_ps_script.bat type script.ps1 | powershell.exe -windowstyle hidden -noprofile –More information about performing seemingly unwanted software can be found in my course at the Microsoft Virtual Academy – “Using hack tools for the audit of the IT environment“.