Textfiles
It nice and easy to work with textfiles but sometimes they contain lines that get's it the way like blank lines or spaces.
To cleanup a textfile you can use powershell.
Let's say you type:
netsh dhcp show server
To list all the dhcp servers in your domain that have been authorized.
This text is copied into a textfile let's say, dhcpservers.txt
It will contain all those empty lines that are not needed when you want to use the textfile for querying those dhcp servers one by one with get-content dhcpservers.txt | etc etc
To get rid of those empty lines you would do:
(get-content \\servershare\sharename\scripts\dhcp_servers.txt) | where {$_ -ne ""} | out-file \\servershare\sharename\scripts\dhcp_servers.txt
page revision: 1, last edited: 12 Apr 2012 12:12