ps1

Order Matters

Here is a challenge for you. The following code is a simple currency converter. However, when you run it, you'll notice it doesn't convert...

read more

Accessing Date Methods

While Get-Date returns the current date and time, it really returns a DateTime object. You can use this object to find out more about the date or to...

read more

Using Cultures

Since PowerShell is culture-independent, you can pick any culture you want and use the culture-specific formats. The following script instantiates...

read more

Accessing Static .NET

You can start to explore the power of .NET with PowerShell's built-in .NET access.. All you will need are square brackets to access static...

read more

Arrays of Strings

In PowerShell, you can multiply strings: the string is repeated which can be useful for creating separators: '-' * 50 This works for words,...

read more

Understanding Trap Scope

Traps are a great way of handling errors but you may want to control where PowerShell continues once an error occurs. There is a simple rule: a trap...

read more

Validate User Input

When you ask users for input you never know what they enter so it is a good idea to validate user input before using it. A great and easy way to do...

read more

Multidimensional Arrays

PowerShell supports two types of multi-dimensional arrays: jagged arrays and true multidimensional arrays. Jagged arrays are normal PowerShell...

read more

Finding System Folders

When you automate file system tasks, you may want to know where special folders such as MyPictures or Documents are located. The .NET class...

read more

Finding the Current User

Should you try and use PowerShell as a log-on script, you may want to know who is actually running the script to access user specific folders or...

read more