-
Notifications
You must be signed in to change notification settings - Fork 1
Assert‑IPv4Address
Asserts that a string is a valid IPv4 address.
Assert-IPv4Address [-IPAddress] <String> [<CommonParameters>]
Validates that the input string represents a valid IPv4 address by checking both format and value ranges (0-255 for each octet). This command also validates that octets do not have leading zeros (except for '0' itself) which is important for proper IPv4 address validation. Throws an exception if the input is not a valid IPv4 address.
Assert-IPv4Address -IPAddress '192.168.1.1'
This example validates a standard IPv4 address. No output is returned if the validation succeeds.
Assert-IPv4Address -IPAddress '999.999.999.999'
This example demonstrates validation failure for an invalid IPv4 address with octets exceeding 255.
Assert-IPv4Address -IPAddress '192.168.01.1'
This example demonstrates validation failure for an IPv4 address with leading zeros in an octet.
Specifies the string to validate as an IPv4 address. The string should be in the format of four decimal numbers separated by periods.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Assert-GitLocalChange
- Assert-GitRemote
- Assert-IPv4Address
- Clear-AnsiSequence
- ConvertTo-AnsiSequence
- ConvertTo-AnsiString
- ConvertTo-DifferenceString
- ConvertTo-RelativePath
- Disable-CursorShortcutCode
- Get-ClassAst
- Get-ClassResourceAst
- Get-GitBranchCommit
- Get-GitLocalBranchName
- Get-GitRemote
- Get-GitRemoteBranch
- Get-GitTag
- Get-LinkLayerAddress
- Get-ModuleByVersion
- Get-ModuleFileSha
- Get-ModuleVersion
- Get-NumericalSequence
- Get-PSReadLineHistory
- Get-TextOffset
- Install-ModulePatch
- Invoke-Git
- Invoke-PesterJob
- New-GitTag
- New-SamplerGitHubReleaseTag
- Out-Difference
- Pop-VMLatestSnapshot
- Push-GitTag
- Receive-GitBranch
- Remove-GitTag
- Remove-History
- Remove-PSHistory
- Remove-PSReadLineHistory
- Rename-GitLocalBranch
- Rename-GitRemote
- Request-GitTag
- Resolve-DnsName
- Resume-GitRebase
- Send-WakeOnLan
- Split-StringAtIndex
- Start-GitRebase
- Stop-GitRebase
- Switch-GitLocalBranch
- Test-FileHash
- Test-GitLocalChanges
- Test-GitRemote
- Test-GitRemoteBranch
- Test-IPv4Address
- Update-GitLocalBranch
- Update-RemoteTrackingBranch