Category: PowerShell

Remote computing and PowerShell 2.0 part 3 – Running a Scriptblock as a background process.

Comments ( 0 )

Background jobs are very useful for commands that take long amounts of time to complete.  A background job can be created on the local computer by using the Start-Job cmdlet. This particular cmdlet cannot be used to run a background job on another computer however. To do that, you would need to use the Invoke-Command [...]

Comments »

Powershell and Mysql featuring the null byte (x00)

Comments ( 0 )

For those of you who follow our blog, Brett does a lot of articles about PowerShell and how great it is. So the other day when I need to do a mysql dump of some data on a Windows 2008 server, I fired it up. The deep blue background touched my inner California beach bum, [...]

Comments »

Remote computing and PowerShell 2.0 part 1 – Getting started

Comments ( 0 )

It’s a pretty routine event for me to be remotely logged into more then one Windows server through Remote Desktop, or even occasionally sending a command from CMD to a remote server. PowerShell has not been left out of the game, when it comes to remote computing.  If you have a Windows 7, and a [...]

Comments »

Powershell the switch statement pt 2.

Comments ( 0 )

The string value specified in the switch statement’s script block has to exactly match a condition for that condition to equal true. Despite it being unnecessary for exact matches, this would be the same as using the -exact option in a switch statement. There are other options available for use such as -wildcard which lets [...]

Comments »

PowerShell Tutorial the switch statement part 1.

Comments ( 1 )

PowerShell’s switch statement is similar to an if statement though easier to implement when you want to evaluate numerous conditions. You can use the switch statement to automate tasks such as retrieving System event log entries and performing actions based on the type of entry, and or moving and deleting files based on their file [...]

Comments »

PowerShell tutorial. The While Statement

Comments ( 0 )

Similarly to the for statement, the while statement is another type of loop that parses through a collection. The while statement also includes a conditional code block and a script block and continues for so long as the conditional code block equal true.

Comments »

Powershell tutorial. The For Statement

Comments ( 0 )

This week’s lesson builds on last weeks tutorial but introduces the For statement. The For statement uses a counting loop that processes and continues through a collection as long as the condition equals true. Similar to If statements, the for statement includes a conditional code block and a script block. However you will see that [...]

Comments »

Windows PowerShell the if statement

Comments ( 1 )

There are several ways to control the flow of code within your powershell scripts. The if, for, and while statements are used to define conditions and the actions to happen when the conditions are met. In this blog I’ll focus specifically on the if statement.

Comments »

PowerShell tutorial 8 part 2

Comments ( 0 )

As I mentioned last time, today’s post is in regards to using pipelines with foreach loops. Whenever you define a collection in a foreach statement, you are more or less setting up a pipeline. Take a look at this example; foreach ($svc in Get-Service | where {$_.status -eq ‘running’}) { $svc.name + “: ” + [...]

Comments »

Powershell tutorial 8 part 1

Comments ( 0 )

By now you should have a pretty good idea how powershell can be leveraged to help you with all sorts of tasks. This tutorial will cover the foreach loop to show you how you can chew through collections such as string arrays or windows services. There are two types of foreach loops in powershell, the [...]

Comments »
Page 1 of 212