Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBookV2
Script Library
Twitter Grid
Featured Posts
Dreaming in PowerShell
Don Jones
Code MarkUp Tool
Directory
April 2012 - The Lonely Administrator
Share
|
Recent Posts
Adding System Path to CIMInstance Objects
Turning CLI Tools into PowerShell Tools
Friday Fun: It’s PowerShell, Baby!
Browse TrainSignal Courses with PowerShell
Friday Fun: View Objects in a PowerShell GridList
Archives
May 2013 (10)
April 2013 (10)
March 2013 (6)
February 2013 (8)
January 2013 (15)
December 2012 (5)
November 2012 (7)
October 2012 (5)
September 2012 (2)
August 2012 (3)
July 2012 (4)
June 2012 (8)
May 2012 (11)
April 2012 (18)
March 2012 (2)
February 2012 (10)
January 2012 (12)
December 2011 (10)
November 2011 (15)
October 2011 (12)
September 2011 (4)
August 2011 (9)
July 2011 (8)
June 2011 (6)
May 2011 (10)
April 2011 (8)
Tags
CommandLine
Conferences
Friday Fun
FridayFun
Function
functions
Get-WMIObject
Google Plus
Group Policy
hashtable
Hyper-V
objects
Out-Gridview
parameter
PowerShell
Powershell 3.0
PowerShell ISE
PowerShell v2.0
ScriptBlock
Scripting
Training
Validation
Windows Server
WMI
Write-Host
View more
Sort by:
Most Recent
|
Most Viewed
|
Most Commented
Friday Fun: 13 More Scriptblocks
In celebration of Friday the 13th I thought I would offer up a menu of 13 more script blocks. If you missed the first course, you can find the original 13 scrptblocks here. I’m not going to spend a lot … Continue reading → Read More...
Published
Fri, Apr 13 2012 9:34 AM
by
The Lonely Administrator
Filed under:
Scripting
,
WMI
,
PowerShell
,
Friday Fun
,
FridayFun
,
ScriptBlock
,
Random
,
ACL
,
password
Friday Fun: Get Next Available Drive Letter
A few days ago I saw on question, I think on Facebook, about using PowerShell to find the next available drive letter that could be used for mapping a network drive. Before I show you my approach, let me state … Continue reading → Read More...
Published
Fri, Apr 06 2012 9:30 AM
by
The Lonely Administrator
Filed under:
Scripting
,
WMI
,
PowerShell
,
Friday Fun
,
FridayFun
,
Array
Create an HTML PowerShell Help Page
Yesterday I posted an article about getting the online url for a cmdlet help topic. Today I want to demonstrate how we might take advantage of this piece of information. Since the link is already in the form of a … Continue reading → Read...
Published
Tue, Apr 03 2012 12:12 PM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
Function
,
ConvertTo-HTML
,
Get-Command
,
Help
,
cmdlet
,
HTML
,
Get-Help
Skipping WMI System Properties in PowerShell
One of my favorite techniques when using WMI in PowerShell is to pipe an object to Select-Object and select all properties. Try this: get-wmiobject win32_bios | select * It works, but it also gets all of the system properties like … Continue...
Published
Wed, Apr 25 2012 8:15 AM
by
The Lonely Administrator
Filed under:
Scripting
,
WMI
,
PowerShell
,
ScriptBlock
,
Get-WMIObject
PowerShell Scripting with [ValidatePattern]
I’ve been writing about a number of parameters attributes you can include in your PowerShell scripting to validate parameter values. Today I want to cover using a regular expression pattern to validate a parameter value. I’m going to assume...
Published
Thu, Apr 19 2012 9:20 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
PowerShell v2.0
,
Regular Expressions
,
Validation
PowerShell Scripting with [ValidateLength]
In continuing the exploration of parameter validation attributes, today we’ll look at [ValidateLength()]. You can use this attribute in your PowerShell scripting to validate that a parameter value is at least a certain length and no more and a certain...
Published
Fri, Apr 20 2012 11:11 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
parameter
,
Validation
PowerShell Scripting with [ValidateScript]
The last few days we’ve been looking at parameter validation attributes you might use in a script of function. Yesterday I wrote about [ValidateRange] and demonstrated how you might use it. That attribute works fine for any values that can …...
Published
Thu, Apr 12 2012 8:57 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
ScriptBlock
,
parameter
,
Validation
Pipeline Power
Last week I came across a blog post that had a decent example using PowerShell and PowerCLI to get the disk location for all virtual machines. The posted code works and does display the information you might be after. $myVMs … Continue reading →...
Published
Wed, Apr 04 2012 1:57 PM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
PowerCLI
,
Pipeline
,
objects
,
ForEach
,
VMware
,
PowerCIi
PowerShell Scripting with [ValidateRange]
After my post yesterday on using the ValidateScript attribute with PSCredentials, I thought you might find it helpful to have a brief discussion on some other parameter validation attributes such as [ValidateRange()]. You can use this attribute if you...
Published
Wed, Apr 11 2012 11:01 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
parameter
,
ValidateRange
Friday Fun: PowerShell Countdown
Recently, Josh Atwell posted a PowerShell script that performed a countdown. Naturally, I was inspired and did the whole “embrace and extend” thing. Don’t get me wrong: Josh’s script is perfectly fine. I saw some opportunities...
Published
Fri, Apr 27 2012 9:05 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
Friday Fun
PowerShell Scripting with [ValidateSet]
Today we’ll continue our exploration of the parameter validation attributes you can use in you PowerShell scripting. We’ve already looked at [ValidateRange] and [ValidateScript]. Another attribute you are likely to use is [ValidateSet()]....
Published
Mon, Apr 16 2012 7:38 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
PowerShell v2.0
,
parameter
,
Validation
PowerShell Scripting with [ValidateCount]
Here’s another parameter validation attribute you might want to use in your PowerShell scripting and functions. If your parameter can take an array of values, you might want to limit that array to a certain size. For example, your parameter …...
Published
Thu, Apr 26 2012 8:38 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
PowerShell v2.0
,
parameter
,
Validation
Scripting with PSCredential
I see this question often: how can I pass a parameter value for a PSCredential that might be a credential object or it might be a user name? In the past I’ve used code like this: begin { … Continue reading → Read More...
Published
Tue, Apr 10 2012 9:40 AM
by
The Lonely Administrator
Filed under:
functions
,
Scripting
,
WMI
,
PowerShell
,
ScriptBlock
,
PSCredential
,
security
Try and Catch Me If You Can
In looking at entries in this year’s Scripting Games, as well as posts I see in PowerShell forums, I thought I’d post a short guide to properly using Try/Catch. This is the way I think it should be used. Let’s … Continue reading...
Published
Thu, Apr 05 2012 8:24 AM
by
The Lonely Administrator
Filed under:
Scripting
,
PowerShell
,
ErrorHandling
,
TryCatch
Technorati Claim – ignore me
Pay no attention to this post. FZ8D4JAWU7Q3 Read More...
Published
Thu, Apr 26 2012 7:10 PM
by
The Lonely Administrator
Filed under:
PowerShell
1
2
Next >
Copyright 2012 PowerShell.com. All rights reserved.