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

shortened hosts file URL creation + other tweaks #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

shortened hosts file URL creation + other tweaks #1

wants to merge 1 commit into from

Conversation

jantari
Copy link

@jantari jantari commented Oct 28, 2018

  • refactored and shortened URL-string creation logic
  • removed unneeded backticks (line-breaks after a pipe are always allowed)
  • added "0.0.0.0" as the default value for the IP parameter instead of setting it later
  • cleaned up regex IP replace and split up the pipeline (get-content and set-content in one pipeline isn't recommended because Get-Content may still have the file opened so Set-Content will fail to write it)
  • replaced all occurences of
`"

(escaped double-quotes) with just ' (single quotes)

  • replaced all instances of
Write-Host `n

with Write-Host "" as

`n

is technically only line-feed but Windows uses CRLF, I think it also looks nicer

- refactored and shortened URL-string creation
- removed unneeded backticks (line-breaks after a pipe are always allowed)
- added "0.0.0.0" as the default value for the IP parameter instead of setting it later
- cleaned up regex IP replace and split up the pipeline (get-content and set-content in one pipeline isn't recommended because
Get-Content may still have the file opened so Set-Content will fail to write it)
- replaced all occurences of `" (escaped double-quotes) with just ' (single quotes)
- replaced all instances of `Write-Host `n` with Write-Host "" as `n is technically only line-feed but Windows uses CRLF, I think it also looks nicer
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

Successfully merging this pull request may close these issues.

None yet

1 participant