DNRTV Screencast - Powershell is still shiny
The string of unscripted DNRs (I hope you don't mind) by Carl and I continued. Last week during lunch, Carl and I recorded an episode of "DotNetRocks TV" where I continue to try and convince Carl that Windows Powershell is a goodness. This is Episode 82 of DNRTV.
If you're not using Powershell yet, why not? I hope this show helps to convince you of its usefulness, or at least give you an idea of why I love it so much.
|
Be aware if you download the ZIP that it's about 200megs. The show is in two parts, so there's an advertisement in the middle of the show...after that advert, Part 2 will automatically start. I encourage you to check it out the ad, first because it's telerik and they sincerely rock, and second because our sponsors pay for the massive bandwidth bills for the direct downloads.
If you like DNRTV, and want to subscribe to the DNRTV Feed, consider using the RSS Downloader features of µTorrent ("microtorrent").
I hope you enjoy the show.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
system('powershell C:\Scripts\MyPowerShellScript.ps1 you can pass args optionally')
The output gets sent to the Ruby console and all is good. Since you can pass arguments to PowerShell scripts and catch them using $args varible, integrating Ruby and PowerShell may be quite an easy job.
Here is what I did.
$logFilePath = $args[0]
$smtp = new-Object System.Net.Mail.SmtpClient("MyEmailServer")
$msg = "Smoke Testing has completed at " + [System.DateTime]::Now.ToString()
$emailMsg = new-Object System.Net.Mail.MailMessage("from@whatever.com", "to@whatever.com", "Smoke Testing Finished", $msg)
$attachment = new-Object System.Net.Mail.Attachment($logFilePath)
$emailMsg.Attachments.Add($attachment)
$smtp.Send($emailMsg)
Write-Host("Email has been sent")
First, it is firmly bolted to .NET and that's fine in a lot of cases, but I want to post scripts and tips that can be used on any currently-supported Windows platform without requiring .NET. So, for me it is cmd.exe and .bat and if not that, then WSH (not to be confused with WHS), JavaScript, and even that raises issues about script blocking, AV tools, and people who carefully avoid hosted JavaScript on the platform, whether or not in the browser. (I will use accelerator features in products like 4DOS and 4NT, that make operating in a console shell much easier and slicker, but I will confine myself to .bat files for scripts I use and distribute to others.)
Secondly, although I've seen claims that it's based on some established Posix principles and standards, PowerShell is a very weird language from my point of view. It may be a lot of fun and powerful, but somehow it just doesn't get my aesthetic juices flowing. So I haven't found a good reason to go over the learning hump. That's probably my age showing. I've concluded that I must have only one geek chromosome rather than the two that was present in so many guys at last night's nerd dinner (which was a lot of fun, just the same).
Finally, I'm answering your question without listening to the 'cast. I will now remedy that while I prune through unread blog-feed articles that piled up while I was out all day yesterday.
Oh, ok. Well, I hadn't watched dnrTV before and I didn't realize what would happen. So I hear people talking and oh, there goes the podcast, I think, but why is my browser opening up instead of media player or something and then ... Oh my gosh, they are pushing some windows download to my computer .... !!
OK, you got me. It was the screencast and you were showing Carl the PowerShell download (running as admin all the time too, huh?) but I thought your site had been hacked and I was being social-engineered to click Run! Heh, heh. No kidding.
All right, all right, that's very impressive. I'm impressed with how you used PowerShell and Power Tab.
And I'm even more impressed with that screencast technology. How do I make those? That interests me even more. OK, going to the search panel now ... you must have talked about this somewhere in wayback ...
Update - When I was trying to get tab expansion on a custom loaded DLL, turns out all I needed to do was Update-TabExpansionTypes to get it. Thanks MoW for the correction!
Comments are closed.
It started to click during the last third of this DNR.
Don't stop there though.. More DNRTV for Powershell.
"Do you want you know more?".....Hell yes :)