@@ -45,6 +45,9 @@ function New-NSLBVirtualServer {
45
45
. PARAMETER IPAddress
46
46
IPv4 or IPv6 address to assign to the virtual server.
47
47
48
+ . PARAMETER NonAddressable
49
+ Bypasses the need for an IPAddress and port for the virtual server to configure it as "Non Addressable"
50
+
48
51
. PARAMETER Comment
49
52
Any comments that you might want to associate with the virtual server.
50
53
@@ -141,17 +144,21 @@ function New-NSLBVirtualServer {
141
144
142
145
[parameter (Mandatory , ValueFromPipeline , ValueFromPipelineByPropertyName )]
143
146
[string []]$Name = (Read-Host - Prompt ' LB virtual server name' ),
144
-
145
- [parameter (Mandatory )]
147
+
148
+ [Parameter (Mandatory = $true , ParameterSetName = " Addressable " )]
146
149
[ValidateScript ({$_ -match [IPAddress ]$_ })]
147
150
[string ]$IPAddress ,
148
-
149
- [ValidateLength (0 , 256 )]
150
- [string ]$Comment = ' ' ,
151
-
151
+
152
+ [Parameter (Mandatory = $true , ParameterSetName = " NonAddressable" )]
153
+ [Switch ]$NonAddressable ,
154
+
155
+ [Parameter (Mandatory = $true , ParameterSetName = " Addressable" )]
152
156
[ValidateRange (1 , 65534 )]
153
157
[int ]$Port = 80 ,
154
-
158
+
159
+ [ValidateLength (0 , 256 )]
160
+ [string ]$Comment = ' ' ,
161
+
155
162
[ValidateSet (' DHCPRA' , ' DIAMTER' , ' DNS' , ' DNS_TCP' , ' DLTS' , ' FTP' , ' HTTP' , ' MSSQL' , ' MYSQL' , ' NNTP' , ' PUSH' , ' RADIUS' , ' RDP' , ' RTSP' , ' SIP_UDP' , ' SSL' , ' SSL_BRIDGE' , ' SSL_DIAMETER' , ' SSL_PUSH' , ' SSL_TCP' , ' TCP' , ' TFTP' , ' UDP' )]
156
163
[string ]$ServiceType = ' HTTP' ,
157
164
@@ -192,14 +199,24 @@ function New-NSLBVirtualServer {
192
199
foreach ($item in $Name ) {
193
200
if ($PSCmdlet.ShouldProcess ($item , ' Create Virtual Server' )) {
194
201
try {
195
- $params = @ {
196
- name = $item
197
- comment = $comment
198
- servicetype = $ServiceType
199
- ipv46 = $IPAddress
200
- port = $Port
201
- lbmethod = $LBMethod
202
- icmpvsrresponse = $ICMPVSResponse
202
+ if ($NonAddressable ) {
203
+ $params = @ {
204
+ name = $item
205
+ comment = $comment
206
+ servicetype = $ServiceType
207
+ lbmethod = $LBMethod
208
+ icmpvsrresponse = $ICMPVSResponse
209
+ }
210
+ } else {
211
+ $params = @ {
212
+ name = $item
213
+ comment = $comment
214
+ servicetype = $ServiceType
215
+ ipv46 = $IPAddress
216
+ port = $Port
217
+ lbmethod = $LBMethod
218
+ icmpvsrresponse = $ICMPVSResponse
219
+ }
203
220
}
204
221
205
222
if ($PSBoundParameters.ContainsKey (' PersistenceType' )) {
0 commit comments