Standard and Advanced PowerShell functions

This post is part of the PowerShell Blogging Week (#PSBlogWeek), a series of coordinated posts designed to provide a comprehensive view of a particular topic.

This week topic will be focused on Windows PowerShell Advanced Functions.

In this post, we'll discuss Standard and Advanced Functions and why you should write advanced functions.

When you have been working with PowerShell for some time, creating reusable tools is an obvious evolution to avoid writing the same code over and over again. You will want to have modular pieces of code that only do one job and do it well - that’s the role of functions.

Let's suppose you have to accomplish a task that requires multiple lines of code, for example:

# Computer System
Get-WmiObject -Class Win32_ComputerSystem
# Operating System
Get-WmiObject -class win32_OperatingSystem
Get-WmiObject -class Win32_BIOS


PowerShell Blogging Week

Next week, from the 30th of March to the 4th of April, I will be participating to the PowerShell Blogging Week with a couple of community well-known Bloggers/Enthusiasts/MVP.

But.. what is the PowerShell Blogging Week: This event was initiated by Jeffery Hicks and Adam Bertram and will focus on one PowerShell topic.

Each participants will be posting one article on his/her affected day, on their respective blog.  You can follow the event by following the blogs bellow, using the twitter hashtag #PSBlogWeek or the Twitter list created by Mike F Robbins.

Topic of the PBW: PowerShell Advanced Functions.

Here’s the list of bloggers who are involved, their Names, Twitter handles and their blog:

Adam Bertram @adbertam http://www.adamtheautomator.com/
Boe Prox @proxb http://learn-powershell.net/
Francois-Xavier Cat @lazywinadm http://www.lazywinadmin.com/
Jeffery Hicks @jeffhicks http://jdhitsolutions.com/blog/
June Blender @juneb_get_help http://www.sapien.com/blog/
Mike F. Robbins @mikefrobbins http://mikefrobbins.com/

Stay tunned !!

Thanks for reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn. You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page.


Update: LazyTS v1.1

I found some time over the week-end to fix some bugs and add a few things to LazyTS. You'll now be able to quickly search though the displayed data using the small highlight util and open a Remote Desktop connection using the Shadow feature (View and Control)

See this link for more information about RDP Shadow.

What is LazyTS ?

LazyTS is a PowerShell script to manage Sessions and Processes on local or remote machines. It also allows you to Disconnect/Stop sessions and Send Interactive message to one or more sessions.

This tool is using the module PSTerminalService which relies on the Cassia .NET Library.I used Sapien PowerShell Studio 2014 to which make life easier if you want to start building WinForms tools and add PowerShell code.

Feature requests and Bugs report
I also want to thank those who are sending me features request and reporting bugs ! This is greatly helpful !!! Merci!! You can contact me using info (at) lazywinadmin.com

2015/03/04 Update: Fixed issue when using RDP Shadow and getting the error "This computer name is invalid"
2015/03/02 Update: Fixed a small issue where you got the following message : Exception setting "Item": "Exception calling "Set_Item" with "2" argument(s): "Cannot set Column 'CurrentTime' to be null. Please use DBNull instead."" This was related to an issue with ConvertTo-DataTable