Topics


Blogs


Forums


Samples


Media


Labs


Resources

 




DevCentral > Weblogs > Joe Pruitt - A Software Architect's take on Network Security

PowerShell ABCs

There are 28 entries for the tag PowerShell ABCs

My Guest Appearance On The PowerScripting Podcast Is Live

Last Thursday night Hal (@halr9000) and Jon (@jonwalz) over at the PowerScripting Podcast had me on their weekly podcast for episode #61.  Hal and Jon are both highly esteemed in the PowerShell community and I caught their attention with my recent PowerShell ABC's blog series. During the interview, I discussed my personal background, F5, the BIG-IP product family, DevCentral, iControl, and our PowerShell implementation.  We ended up the interview going a bit more in depth with a few of my ABC posts including Generics, JavaScript, Synthetic Members.  If you listen long enough, you'll also find out what...


posted @ Tuesday, March 03, 2009 9:45 AM | Feedback (0)

PowerShell ABC's - A To Z

With yesterday's post, another 26 blog posts are in the can.  For those who missed the first 26 PowerShell ABC's, here's the complete list.     Arithmetic Operators: Unlike strongly typed languages like C/C++ and Java, PowerShell is a dynamically typed language meaning that it can "morph" data types depending on the context in which they are used.  This comes in handy when you need to do string manipulations.  PowerShell has the standard arithmetic operators you would expect from basic programming language.   begin: For all you Cmdlet writers out...


posted @ Tuesday, February 10, 2009 8:23 AM | Feedback (1)

PowerShell ABC's - Z is for zh-CHT

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "Z", I'll discuss PowerShell's internationalization features and it's support for country cultures like zh-CHT. PowerShell 2.0 added features that make script internationalization relatively simple to implement.  The script internationalization features query the user interface culture of the operating system during execution, import the associated translated text strings, and allows you to display them to the user.  To support international text, PowerShell 2.0 includes the following features: ...


posted @ Monday, February 09, 2009 1:27 PM | Feedback (1)

PowerShell ABC's - Y is for Yellow

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "Y", I'll discuss PowerShell's host interface and, most importantly, it's ability to specify one of my favorite colors Yellow. PowerShell is really an engine that operates within a hosting application, the default being the PowerShell.exe command line application.  The host serves to expose a command line and a host interface to communicate with the commands invoked by the command line.    The Cmdlets There are several buildin...


posted @ Friday, February 06, 2009 9:13 AM | Feedback (0)

PowerShell ABC's - X is for XML

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "X", I'll discuss PowerShell's ability to work natively with XML. XML (Extensible Markup Language) is being used more and more in today's computing environments.  PowerShell is no exception in that it uses XML for its type and configuration files as well as for it's help system.  Since PowerShell uses XML so much internally, it makes sense that it has to expose a way to process XML documents...


posted @ Tuesday, January 27, 2009 9:42 AM | Feedback (0)

PowerShell ABC's - W is for Widening

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "W", I'll talk about PowerShell's type-promiscuous feature of numeric widening. PowerShell is a type-promiscuous language in that PowerShell will do it's best to try to convert whatever type of literal you are using into the type you need with as little work on your part as possible.  This means that if you want to multiple a number by a string representation of a number, it will behave as...


posted @ Monday, January 26, 2009 9:25 AM | Feedback (0)

PowerShell ABC's - V is for Voidable Statements

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "V" I will talk about default statement output, and specifically voidable statements. In traditional programming languages, statements do not return a value.  Think of the C++ increment operator in the following statement: "a++;".  In this example the value of variable a is incremented by one.  The value of the variable a is not returned from this statement.  In fact, All C/C++/C# statements do not return values.  This is...


posted @ Friday, January 23, 2009 8:12 AM | Feedback (2)

PowerShell ABC's - U is for Unraveling

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "U" I will talk about PowerShell's automatic unraveling of collections. To unravel is to "separate or disentangle the threads" or "to free from complication or difficulty; make plain or clear". One problem that people run into with .NET methods that return enumerators is that PowerShell will unravel the enumerator by default.  By this I mean that it will "take it apart" and put it in a format that...


posted @ Wednesday, January 21, 2009 9:15 AM | Feedback (0)

PowerShell ABC's - T is for Type Literals

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter of "T" I will talk about type specification and, in particular, Type Literals. If you've seen any example PowerShell scripts, you've likely seen some syntax that looks like [type].  This is referred to as a type literal.  In PowerShell, you can use type literals to specify a particular type for your operation. Type literals can be used  in several ways.  They can be used as operators in a type...


posted @ Tuesday, January 20, 2009 10:13 AM | Feedback (4)

PowerShell ABC's - S is for Synthetic Members

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  For today's letter is the letter "S", I will discuss PowerShell's extension of existing object with Synthetic Members. A powerful feature in PowerShell is it's ability to extend existing object types and instances.  In doing so, it can overlay a common set of interfaces onto an existing source of data.  This is different that the traditional method of sub-classing or creating types derived from other types in other object-oriented programming languages where...


posted @ Monday, January 19, 2009 10:12 AM | Feedback (0)

PowerShell ABC's - R is for Runspace

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "R" and for it I'll cover the runspace. If you've downloaded PowerShell, you may think of PowerShell as a console application that is a replacement for the old CMD.EXE console.  That is true in that the process is called PowerShell.exe, but there is much more to it.  PowerShell is simply a console application that hosts the PowerShell runtime using a console window as a mechanism for allowing the...


posted @ Friday, January 16, 2009 10:08 AM | Feedback (0)

PowerShell ABC's - Q is for Queues

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "Q" and there wasn't really much to go with.  We've got the "-Quiet" switch but that's fairly limited in it's usage.  I opted for it's support for the FIFO data structure: queues. A queue is a particular kind of collection in which the entities in the collection are kept in order.  Operation on a queue are to add items to the end position and remove them from...


posted @ Wednesday, January 14, 2009 10:21 AM | Feedback (0)

PowerShell ABC's - P is for Parameters

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "P" and for it I'll cover the basics of defining input values, or Parameters. Parameters (or arguments) are how you customize the actions of a command.  There are 4 types of commands in PowerShell, scripts, functions, Cmdlet's, and External Commands.  Scripts and Functions are the areas I'm going to focus on here and I'll show you how parameters are defined in those two command types. Scripts Scripts,...


posted @ Tuesday, January 13, 2009 10:55 AM | Feedback (9)

PowerShell ABC's - O is for Output

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "O" and for this letter I'll discuss the Output system. PowerShell, like most other scripting languages, wouldn't be much use without an input and output system for retrieving or sending data.  PowerShell has various output systems. The Pipeline A pipeline is a series of commands separated by the pipe operator "|".  Each command in the pipeline receives an object from the previous command, performs some operation on...


posted @ Friday, January 09, 2009 10:33 AM | Feedback (2)

PowerShell ABC's - N is for Numbers

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "N" and for this letter I'm going to discuss one of the core types of objects you'll likely be dealing with: Numbers. PowerShell supports all of the basic .NET numeric types and performs conversions to and from the different types as needed.  The types, along with the PowerShell type names are in the following table .NET Full Type Name |...


posted @ Thursday, January 08, 2009 8:03 AM | Feedback (0)

PowerShell ABC's - M is for Matching

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "M" and I'm going to touch on the power of regular expressions and pattern Matching. Along with the basic comparison operators (-[ci]eq, -[ci]ne, -[ci]gt, -[ci]ge, -[ci]lt, -[ci]le, -[ci]contains, and -[ci]notcontains), PowerShell has a number of operators allowing one to perform pattern matching comparisons.  These operators work on strings, matching and manipulating them using the wildcard and regular expression patterns.     Wildcard Patterns ...


posted @ Wednesday, January 07, 2009 8:21 AM | Feedback (0)

PowerShell ABC's - L is for Location

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "L".  For "L" I'm going to give an overview on Location. The current working location is the default location to which commands point if you don't supply an explicit path to the item or location that is affected by the command. In most cases, the current working location is a directory on a drive supplied by the built-in FileSystem provider but it doesn't have to be.  ...


posted @ Tuesday, January 06, 2009 8:23 AM | Feedback (0)

PowerShell ABC's - K is for Keywords

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "K".  I had some recommendations for "Kill" and "Keep" but I think I found one a little bit more topical.  Today I'm going to talk about PowerShell keywords. First of all, let's talk about keywords.  A keyword, in a programming language such as PowerShell, is a word or identifier that has a particular meaning to that language.  In most languages, keywords are reserved words - meaning that they...


posted @ Monday, January 05, 2009 10:52 AM | Feedback (2)

PowerShell ABC's - J is for JavaScript

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "J".  Bet you thought I was going to go with Jagged Arrays for this one huh?  Nope!  Today's word is JavaScript. Huh?  You may ask why I would pick JavaScript since that is a completely different scripting language and this is a series on PowerShell features.  Well, I'm glad you asked.  PowerShell is a very extensive scripting language, but it is relatively new to the scene of windows...


posted @ Friday, January 02, 2009 12:36 PM | Feedback (1)

PowerShell ABC's - I is for is

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "I".  For "I", I opted for a couple of operators that you might not know about, but come in very handy with PowerShell's loosely typed framework.  The word for today is "is" (with a double bonus of "isnot" and "as"). In a previous post, I talked about the PowerShell's Arithmetic Operators.  In addition to Arithmetic, there are Assignment (=, +=, -=, *=, /=, %=), Comparison (-[ci]eq, -[ci]ne, -[ci]gt,...


posted @ Wednesday, December 31, 2008 11:46 AM | Feedback (1)

PowerShell ABC's - H is for Here-String

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "H".  For "H", I'm going to talk about a feature that PowerShell Guru Jeffrey Snover loves talking about each time I see him: Here-Strings. Before we get to here-strings, it's probably a good idea to go over the different kinds of string literals in PowerShell.  There are actually 4 different kinds of string literals - single-quoted strings, double-quoted strings, single-quoted here-strings, and double-quoted here-strings.  All of these...


posted @ Tuesday, December 30, 2008 11:36 AM | Feedback (1)

PowerShell ABC's - G is for Generics

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "G".  For "G" I've picked a feature that was introduced in version 2.0 of the .NET Framework that allows for creating more generic types of objects.  So, today's word is "Generics". Generics allow you to create generic objects such as collections without being constrained to the specific type of object that it contains.  Generics introduce the "type parameter" that you pass in to the creation of an object...


posted @ Monday, December 29, 2008 10:01 AM | Feedback (2)

PowerShell ABC's - F is for Format Operator

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "F".  For "F" I've picked the word that relates to how you can make nice and pretty output.  Today's word is the Format operator (-f). Most often, PowerShell's build in output formatting is good enough for your needs.  But, there will always be those times when you want a more fine grained control over the formatting of your output.  You may also want to format strings in a specific...


posted @ Friday, December 19, 2008 10:27 AM | Feedback (2)

PowerShell ABC's - E is for ExecutionPolicy

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "E".  For "E" I've picked the word that relates to how PowerShell's security model supports execution of scripts.  Today's word is ExecutionPolicy. One of the main features of PowerShell is the ability to execute scripts.  But, scripts are not inherently "safe" and since PowerShell has no concept of sandboxing, the execution of scripts are disabled by default.  The default way to execute scripts is via the console interpreter....


posted @ Thursday, December 18, 2008 1:02 PM | Feedback (0)

PowerShell ABC's - D is for Debugging

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "D".  For "D" I've picked the a term that most everyone who writes scripts needs to understand.  The word for today is debugging. Debugging is a very large category so I'll scan over the various components and dig more into script level debugging since that is what most users will use most often. Basic Error Handling PowerShell implements two types of errors: terminating and non-terminating.  Terminating errors will...


posted @ Wednesday, December 17, 2008 12:42 PM | Feedback (5)

PowerShell ABCs - C is for CmdLet

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "C".  For "C" I've picked the most efficient type type of commands supported by PowerShel, the CmdLet. CmdLets (pronounced "Command-let"), functions, scripts, and native Win32 executables are the four types of commands supported in PowerShell.  A Cmdlet is implemented by a .NET class that derives from the Cmdlet base class in the PowerShell SDK.  This class is compiled into a DLL and loaded into the PowerShell process.  Since a...


posted @ Tuesday, December 16, 2008 8:50 AM | Feedback (0)

PowerShell ABC's - B is for begin

Welcome to this addition of the PowerShell ABC's where you'll find 26 posts detailing a component of the PowerShell scripting language, one letter at a time.  Today's letter is the letter "B".  For "B" I've opted to go with a keyword that you likely don't know about but can allow you write script level functions that behave like compiled Cmdlets.  The word for today is "begin" Most PowerShell users write script level functions as standalone statements that work on values in the pipeline but since functions run all at once, they cannot do streaming processing.  Filters can be used run...


posted @ Monday, December 15, 2008 11:42 AM | Feedback (2)

PowerShell ABC's - A is for Arithmetic Operators

Well, now that I've got the Networking and Social Media ABC's completed it's time for another round of glossary fun and games.  Being from a development background, I figure it's about time to focus on something a little more technical.  For a while now, I've been toying with the PowerShell scripting language from Microsoft so I figure that's as good a place as any to get started on a new series.  So, in the next 28 work days or so, be on the looking for another ABC listing of all the need goodies in the PowerShell language. Since there's...


posted @ Friday, December 12, 2008 2:42 PM | Feedback (1)