globalscape/powershell/Log-EphemeralPortStats/SetupLogEphemeralPort.bat

4 lines
315 B
Batchfile

mkdir %windir%\Tools
copy /Y Log-EphemeralPortStats.ps1 %windir%\Tools\Log-EphemeralPortStats.ps1
schtasks /create /F /tn LogEphemeralPorts /sc onstart /tr "powershell.exe %windir%\Tools\Log-EphemeralPortStats.ps1 -OutputFilePath %windir%\Tools\EphemeralPortStats.log" /ru System
schtasks /run /tn LogEphemeralPorts