Showing archive results for 2006

Aug 3, 2006
Post comments count0
Post likes count0

Windows PowerShell and the “PowerShell Worm”

PowerShell Team

Updated Aug. 5th, 2006: The Microsoft security folks have finished their full technical analysis of the worm. You can read their analysis in the Malicious Software Encyclopedia.   A “PowerShell Worm” has recently been reported by several antivirus companies and some news organizations. There has been some confusion and concern around...

SECURITY
Aug 2, 2006
Post comments count0
Post likes count0

Joel-On-Software on the power of a good language

PowerShell Team

Joel Spolsky of Joel-On-Software fame, just posted a blog, "Can Your Programming Language Do This?" http://www.joelonsoftware.com/items/2006/08/01.html In this article, he drives home the point that when it comes to code: Maintainability, Readability, Abstraction == Good!  He then points out how languages can help or hinder this and goes on to...

FAQLANGUAGE
Aug 1, 2006
Post comments count0
Post likes count0

ScriptCenter EventLog Article

PowerShell Team

ScriptCenter has a very good article exploring the use of Windows PowerShell to analyze your eventlogs.  Check it out at: http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/get-eventlog.mspx PSMDTAG:CMDLET: Get-EventLog PSMDTAG:FAQ: EventLog - How do I find out what event logs exist?  ANSWER: Get-EventLog -list PSMDTAG:...

FAQGet-EventLog
Aug 1, 2006
Post comments count0
Post likes count0

Scott Hanselman's Beantown.Net presentation

PowerShell Team

Scott Hanselman is a superstar presenter.  Here is a link to a video of presentation he gave to the Beantown.net users group in boston that focused on Windows PowerShell.  Even if you are a longtime PowerShell user, I encourage you to watch this because Scott provides some great ways to think about things.  http://www.wrox.com/...

Scott Hanselman
Aug 1, 2006
Post comments count0
Post likes count0

Encoding Operations Knowledge

PowerShell Team

One of the primary goals of Windows PowerShell is to encode operations knowledge.   Consider the example of finding out what domain role a computer plays.  If you look at the WMI class WIN32_COMPUTERSYSTEM, you'll see that it tells you this information:   PS> Get-WMiObject Win32_computerSystem |fl dom*Domain  &...

FAQPHILOSOPHYWMI
Jul 31, 2006
Post comments count0
Post likes count0

Why do I sometimes get different types?

PowerShell Team

PSMDTAG:FAQ: Why do I sometimes get different types or different behaviors? PSMDTAG:FAQ: When I pipe a heterogenous set of objects to an cmdlet that expects a homogenous stream - what happens and why? In our newgroup ( Microsoft.public.Windows.PowerShell ), Alex A asked these questions with the following example: cd c:\temp$( gci ; gci hkcu:\ ) | ...

FAQINTERNALTypes
Jul 31, 2006
Post comments count1
Post likes count0

Suppressing return values in PowerShell functions

PowerShell Team

PSMDTAG:FAQ: How do I supress return values in PowerShell functions? This was asked in a newgroup with the clarification: What I mean is:When you call a function Foo that returns a bool, PS will write 'True' or 'False' to the screenby default. Is there anyway to get it to stop writing those return values? Let's illustrate the issue: PS> functio...

FAQFunctionsReturn Values
Jul 25, 2006
Post comments count0
Post likes count0

Creating arbitrary delegates from scriptblocks in PowerShell…

PowerShell Team

People have been asking about creating arbitrary delegates out of scriptblocks. As Jeffrey has mentioned, this isn't directly supported in V1.0 of PowerShell. It is, however, possible to do it using dynamic methods and the CreateDelegate call. Here's a script (also attached) that will do it. I haven't tested this very much so it may not work in all...

ScriptBlockDelegates
Jul 24, 2006
Post comments count0
Post likes count0

Casting a scriptblock to an arbitrary delegate signature

PowerShell Team

Arild asked the following in http://arildf.spaces.msn.com/blog/cns!E99F8B43533149B0!140.entry?_c%3dBlogPart : PSMDTAG:FAQ: Delegates - how to cast a scriptblock to an arbitrary delegate signature? ANSWER - You can't in V1.0. In version 1.0 Windows PowerShell only supports casting scriptblocks to delegates with the signature: vo...

FAQDOTNETScriptBlock
Jul 23, 2006
Post comments count0
Post likes count0

Issues with Windows PowerShell syntax

PowerShell Team

REI recently posted some comments/requests about Windows PowerShell syntax at: http://blogs.msdn.com/powershell/archive/2006/04/25/583273.aspx#675133 Let's go through a few of the points. ...the syntax was just way too cryptic and unintuitive. Often it's even dangerous. Like this: #PowerShell's syntax causes dangerous problems generating incorrec...

FAQLANGUAGEPARSER