-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make module easier to use: Add powershell Functions #4
Comments
Hi,
You specify a computername, default behavior uses localhost, to create and return a new instance of [HostsFile]
Example 1: Example 2: Example 3 Example 4 What do you think ? |
Yeah, I love it! |
PR for the 2 functions |
Working on Save-HFMHostFileEntry and New-HFMHostsFileBackup |
I implemented the save-hfmhostsfiles
this is how i implemented it Should i PR our do i check ths class directly ? |
Hi, this behaviour is normal, actually. Class HostsFile {
hidden [HostsEntry[]]$Entries
[string]$Path
hidden [int]$LogRotation = 5 I see you found the property. I would suggest you add the following method to the class [HostsFile]
This will allow us, to be able to change the implementation od SetLogRotation easier. |
I think we need a Remove-HFMHostsFileEntry Maybe the Removing process should work like this :
And maybe me can add a switch that removes all comments... ! pretty useless, but whatever :) |
This module is classes based. With experience, I noticed that end users don't really embrace using classes that much, and are more willing to work with functions / cmdlets, thing they are used too since a few years already.
In order to make this module easier for the public embrace, and to abstract the complexity for the end users, and add an encapsulation layer, I would like to add the following cmdlets / functions (See below)
Technical implementation details:
Each cmdlet should have the following:
Please fork, and create an individual branch per function.
Get-HFMHostsFile
Get-HFMHostsFileContent
New-HFMHostsFileEntry
-Type (Must be of type [HostsEntryType])
Set-HFMHostsFileEntry
Save-HFMHostFileEntry
New-HFMHostsFileBackup
Remove-HFHMHostsFileEntry
The text was updated successfully, but these errors were encountered: