Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Hosts file with a twist…

$
0
0

I’m not sure if this is even possible, but I figured I’d ask and see if anyone has come up with a solution for something similar.

I’ve automated a lot of my deployment processes, but one things I haven’t found an elegant way to do is checking the status of specific websites after a deployment. My issue is that we have 2 nodes for our system, and I have to make edits to my hosts files to force myself to connect to a specific node when I’m doing a check. My checks themselves are automated within a powershell script, but I was wondering if there is a way to force powershell to use different values than what are in my hosts file currently.

It’s easy enough to write a script that updates my current file, adding, removing or changing, but I would like to, if possible not have to do that. I want to make sure it’s always in the same state when I finish with the deployment. There are again ways around that, but I would prefer, if possible, not needed to manipulate the hosts file in any manner. Does anyone have ideas on how I could accomplish this?

submitted by /u/Merakel
[link] [comments]

The post Hosts file with a twist… appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles