You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Via String: It would be good to have have the user to write a string, which could be a FQDN or an IP address. In the background, we could handle this using a regex, and according to the type, we will fetch the corresponding entry, and if present, remove it. Perrhaps, this one should also be an array.
These are the cases I could think of
Remove-HFMHostsFileEntry-Entry "192.168.1.34"Remove-HFMHostsFileEntry-Entry "Server01"# Your example:$a=Get-HFMHostsFile$b=Get-HFMHostsFileContentRemove-HFHMHostsFileEntry-Entry $b[0..5] #remove 6 first entries # Parameters should be singular.
I think this could be managed simply using a switch -Regex
where we will identify if it is IP, FQDN, netbiosName
Alos check if of Type [Entrytype]
`
#PseudoCode:
if($Entry.GetType().FullName -eq "EntryType"){
#Do work
}Else{
Isolating discussion from #4
@LxLeChat It make sense to me to be able to remove an entry. I think we should offer the possibility to to the end user to do it in several ways:
Hostsentry
objects from a given HostsfileThese are the cases I could think of
I think this could be managed simply using a
switch -Regex
where we will identify if it is IP, FQDN, netbiosName
Alos check if of Type [Entrytype]
`
#PseudoCode:
if($Entry.GetType().FullName -eq "EntryType"){
#Do work
}Else{
}
`
Somethig like that
The text was updated successfully, but these errors were encountered: