-
Recent Posts
Recent Comments
Archives
- April 2015
- March 2015
- September 2014
- June 2014
- May 2014
- March 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- January 2013
- December 2012
- October 2012
- July 2012
- May 2012
- March 2012
- February 2012
- January 2012
- December 2011
- December 2010
- October 2010
Categories
Meta
Category Archives: powershell
one liner for event log
We have an application whose service keeps stopping. I have a powershell script to check for this and to restart the service, however you can also set a property on the service to restart it on failure. There are options … Continue reading
Posted in powershell, programming, Uncategorized
Leave a comment
hashtables – how cool is this?
http://mjolinor.wordpress.com/2012/01/29/powershell-hash-tables-as-accumulators/
I use hashtables ALOT – especially to generate counts or lists of values associated with a unique key.
Something like
if($hash.containskey($mykey))
{
$hash.Set_Item($mykey, $hash[$mykey] + 1)
}
else
{
$hash.add($mykey,1))
} # end if/else
$hash will (shortly) contain a list of keys and their count. You can put other things in as well.
This post by mjolinor is truly great for that (and there is more)
Posted in powershell
Leave a comment
outta space – again
We ran out of space on ANOTHER server again. I wrote a script to remove entries in the tomcat\temp directory, but that was just for ‘my’ snapshot server, and hadn’t had time to extend that to the others. So we … Continue reading
Posted in blackboard, powershell, Uncategorized
Leave a comment
Powershell and ZIP/UNZIP
The consultant wanted all the W3SVC log files. We didn’t have them (all), but Blackboard stores them – along with other logs, in the archive directory. In a ZIP file. I did NOT want to unzip hundreds of archives to … Continue reading
Posted in powershell
Leave a comment