Wednesday, 25 February 2009
Fries with that...?
Tuesday, 24 February 2009
Windows 7 on a netbook?
Friday, 20 February 2009
Unplugged
That said the effects of going tech-free for a few days are beginning to kick-in: despite finding it very easy to summon up enough willpower not to check my work email, resisting the call of the Wii (specifically House of the Dead: Overkill) is getting tough....
Tuesday, 10 February 2009
Preventing boredom with numbers (and Powershell)..part 2
[Convert]::ToString(734, 2)
or to hex:
[Convert]::ToString(734, 16)
Adding the convert functionality to my one-liner stopped it being just that (a one-liner!) and it 's now:
$1=0;$2=1;$3=$1+$2
do{
$3hex=[convert]::ToString($3, 16)
$3bin=[convert]::ToString($3, 2)
$output="$3`t`t$3hex`t`t$3bin"
$output
$1=$2;$2=$3;$3=$1+$2}
while ($3 -lt 10000000)
So thanks to the power of excessive post-it note usage I've tried something new with Powershell today...
Monday, 9 February 2009
Querying event logs with Powershell
So I started off by simply showing what happens when you run get-eventlog from the Powershell prompt:
then restricting it to just errors:
get-eventlog Application where {$_.EntryType -eq "Error"}
and then to limit the numbers of days to check back through (in this case 3 days):
$date = Get-Date
$recent= $date.AddDays(-3)
Get-EventLog Applicationwhere {($_.TimeWritten -ge $recent) `
-AND ($_.EntryType -eq "Error")}
And so the rest of the session went on, also going through how the script built an array of the available logs and then iterated through each one in turn. End result was that they now had PS script that could quickly check a machines event logs for errors (GUIs are so overrated), but more importantly they had a useful and relevant intro to Powershell (as well as a good understanding of how the script worked).
And the most important cmdlet that I told them about (almost a dozen times)?
get-help