This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Test-TCP { | |
| <# | |
| .SYNOPSIS | |
| Test TCP Port with a low and configurable timeout | |
| .NOTES | |
| Not my own work. Copyright to the author. | |
| #> | |
| Param($address, $port, $timeout = 250) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ECHO OFF | |
| REM Generic cmd file to run powershell script of same name. | |
| REM Rename this CMD file to the same name as the .PS1 file. | |
| REM All arguments are sent to the powershell script as-is | |
| REM I use -Command option as it better handles the script arguments. | |
| setlocal DisableDelayedExpansion | |
| set receivedargs=%* | |
| set scriptname=%~dpn0 | |
| set scriptname=%scriptname%.ps1 | |
| C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -Command ^& '%scriptname%' %receivedargs% |