< Back

New-HFMHostsFileEntry

Tue Jan 14, 2020 1:37 am

NAME New-HFMHostsFileEntry



SYNOPSIS

Create a new Hosts File Entry.





SYNTAX

New-HFMHostsFileEntry [[-IpAddress] <String>] [[-HostName] <String>] [[-FullyQualifiedName] <String>]

[[-Description] <String>] [-EntryType] <String> [<CommonParameters>]





DESCRIPTION

Create a new Hosts File Entry.





PARAMETERS

-IpAddress <String>



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostName <String>



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FullyQualifiedName <String>



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EntryType <String>



Required? true

Position? 5

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

Mostly Strings.





OUTPUTS

A [HostsEntry] object.





NOTES





This cmdlet uses Class.HostsManagement classes, by @StephaneVG

Fork hist project if you like it: https://github.com/Stephanevg/Class.HostsManagement

Visit his site, and read his article a boute pratical use of PowerShell Classes:

http://powershelldistrict.com/powershell-class/



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



PS C:\\>$NewEntry = New-HFMHostsFileEntry -IpAddress "20.0.0.0" -HostName "toto" -FullyQualifiedName "toto.com"

-Description "ahahha" -EntryType Comment



Create a new comment entry.











RELATED LINKS