PowerScripting Podcast – Episode 11

27 10 2007

A Podcast about Windows PowerShell.

Listen:

Introduction

News

  • PowerShell Community (powershellcommunity.org)
    • “Real” non-profit organization created by corporate sponsors including Microsoft, Quest, Sapien, and ShellTools.
    • Event calendar, blog hosting, forums, etc.
    • Still under construction.
  • PowerShell Central (powershellcentral.com)
    • Hosted by BSonPosh and lots of help contributed by Jaykul.
    • “All PowerShell bloggers” aggregate news feed, very cool script repository, news, etc.
    • Still under construction.
  • Relaunch and refocus of Powershell Live (ShellTools) as well as a new developer blog. New features in development like context menus for collections and pipelines.

Resources

Tips

Cmdlet of the week

  • Write-Verbose
    • Use in parameter section of functions and combine with an If statement to enable or disable verbose logging.
    • Function Get-Foo {
      Param ( [switch] $Verbose )
      If ($Verbose) { $VerbosePreference = “Continue” }
      Write-Verbose “My verbose stuff goes here
      Write-Verbose “
      and is not seen at all unless”
      Write=Verbose “I supply the -verbose switch”
      }

One-Liners

  • write-verbose “$(Get-Date -f ’s’) my log entry goes here”

Gotchas

  • Problems occur when a brackets “[” are in your filenames.
  • Careful with following the $_ automatic variable by a colon
    • Out-Host “This $_:won’t work right.”
    • Out-Host “This ${_}:will.”

Thanks for listening! We love feedback and news tips, you can send them to powerscripting@gmail.com. Join our Facebook group “PowerScripting Podcast”.


Actions

Information

4 responses

29 10 2007
Darrin

My life is now complete, I’m immortalized in podcast form. Thanks for the nice words Jonathan and Hal. I posted my solution on the forum, I used your work around, then manually found the files in question.

29 10 2007
Kirk Munro

Hi guys,

I just noticed, the MP3 file containing the podcast seems to have a typo in the email address in the file properties (gmial instead of gmail).

-
Kirk Munro
Poshoholic
http://poshoholic.com

30 10 2007
Jonathan Walz

Hi Kirk,

Thanks for letting us know about the error. I have corrected the id3 tags.

Jonathan

30 10 2007
Darrin

I could almost kiss you Hal. Not really but it’s a figure of speech, while this story is not Powershell, I was able to use something you said in the podcast.

You mentioned using Plink to run a command against your ESX servers, well we have multiple asterisk servers at our company. We use two products to monitor our servers, however, one cannot directly monitor a a non-windows box. However, it can use vb scripts. So using plink I was able to construct a script to run pink, and run certain commands against the server, and with the return value I can tell if the asterisk daemon is running. Thanks.

Leave a comment