< Back

Get-BroadcastAddress

Wed Jan 15, 2020 2:24 am

NAME Get-BroadcastAddress



SYNOPSIS

Get the broadcast address for a network range.





SYNTAX

Get-BroadcastAddress [-IPAddress] <String> [[-SubnetMask] <String>] [<CommonParameters>]





DESCRIPTION

Get-BroadcastAddress returns the broadcast address for a subnet by performing a bitwise AND operation against the

decimal forms of the IP address and inverted subnet mask.





PARAMETERS

-IPAddress <String>

Either a literal IP address, a network range expressed as CIDR notation, or an IP address and subnet mask in a

string.



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SubnetMask <String>

A subnet mask as an IP address.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String





OUTPUTS

System.Net.IPAddress





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-BroadcastAddress 192.168.0.243 255.255.255.0



Returns the address 192.168.0.255.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-BroadcastAddress 10.0.9/22



Returns the address 10.0.11.255.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-BroadcastAddress 0/0



Returns the address 255.255.255.255.









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-BroadcastAddress "10.0.0.42 255.255.255.252"



Input values are automatically split into IP address and subnet mask. Returns the address 10.0.0.43.











RELATED LINKS