Skip to content
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

Add support for profiles/fragments #10

Open
richardszalay opened this issue Jun 28, 2017 · 0 comments
Open

Add support for profiles/fragments #10

richardszalay opened this issue Jun 28, 2017 · 0 comments

Comments

@richardszalay
Copy link
Owner

richardszalay commented Jun 28, 2017

Profiles (essentially "host file fragments") would allow entire blocks of IP addresses to be saved and applied/removed from the system hosts file. Primary use case are swapping entire sets of domains between different environments (or to bypass a load balancer), or simply shipping a set of "dev" host entries along with an application.

Initial thoughts on Cmdlets:

Export-HostsProfile -Hosts @("hosta", "hostb*") -Profile SomeProfile
Remove-HostsProfile -Profile SomeProfile - Essentially just Remove-Item on the file
Publish-HostsProfile -Profile SomeProfile - Merges a hosts profile into the hosts file, basically calling Set-HostEntry -Force for each of them.
Unpublish-HostsProfile -Profile SomeProfile - Removes all host entries specified by a profile (no attempt to restore previous values)

(Profile is either a path to a file or potentially just be a name, in which case it will be stored in Documents\PsHosts\Profiles)

It's probably unnecessary for any of these cmdlets to be C#, since they are all wrapping basic functionality around the core hosts cmdlets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant