File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using namespace System.Management.Automation.Language ;
21<#
32. SYNOPSIS
43 udp protocol
@@ -7,7 +6,7 @@ using namespace System.Management.Automation.Language;
76. EXAMPLE
87 udp://127.0.0.1:8568 # Creates a UDP Client
98. EXAMPLE
10- udp:// -Host [ipaddress]::broadcast 911 -Send "It's an emergency!"
9+ udp:// -Host [ipaddress]::broadcast -port 911 -Send "It's an emergency!"
1110. EXAMPLE
1211 {send udp:// -Host [ipaddress]::broadcast -Port 911 "It's an emergency!"}.Transpile()
1312. EXAMPLE
@@ -17,11 +16,19 @@ using namespace System.Management.Automation.Language;
1716
1817 Invoke-PipeScript { receive udp://*:911 -Keep }
1918#>
19+ using namespace System.Management.Automation.Language
20+
2021[ValidateScript ({
2122 $commandAst = $_
2223 if ($commandAst.CommandElements [0 .. 1 ] -match ' ^udp://' -ne $null ) {
24+ if ($commandAst.CommandElements [0 ] -notmatch ' ^udp://' ) {
25+ if ($commandAst.CommandElements [0 ].value -notin ' send' , ' receive' ) {
26+ return $false
27+ }
28+ }
2329 return $true
2430 }
31+
2532 return $false
2633})]
2734param (
You can’t perform that action at this time.
0 commit comments