Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
agox452y@ScriptCoded Have you got a solution that you can go on a server and **remember it** without developing an application for that only (simple) purpose? Please share it!
-
agox452yHi folks. I come up with a solution that is easy enough to be remembered. (Making simple things simple should be PS designer's job. Yes. If you are a PS designer please notice how hard it is doing usefull stuff with your programming API). However here it is. for(;;) { Test-Connection 192.168.1.10; ac test.txt "$($?) $(Get-Date)" }
-
agox452y@agox I considered several overcomplex solution before trying to come up with mine. The effort here is to crate the most compact, easy to remember possible solution. The key is $? variable; this allowed me to overcome the sort of bizzarre desgin that a 'Test-*' function does not return 'fail' but an error when it fails. This in turn makes it difficult to trace the failures by simply piping the output since when in error there is no output. Funny design.
Related Rants
Ok, we were troubleshooting a network connection problem. My boss told me: use fping, a small command line utility that gives you a timestamped ping. We can then check when did the connection go down. Ok. Since I've always advocated the importance of knowing advanced scripting tools, i tried to do it with powershell. I've been playing with Test-Connection for an hour to try to get not only the timestamp when the connection is ok, but the timestamp when the connection is down. Don't want to go into details. I've just a question. A solution that allows you to do such an easy task in say 20 lines of code is the proof that the system works or that it doesn't work? To make long story short, now i'm downloading fiping.
rant
powershell