Once again, another great Saturday IT Pro event at Keiser University in Sarasota, Florida. It was awesome to see some great speakers giving their sessions, and I got to meet Pinal Dave which is pretty well known in the SQL Server Community Worldwide. See below picture (Me and Pinal Dave).
Microsoft IT Pro Evangelist Blain Barton put together a great Windows Azure session with Herve Roggero (Windows Azure MVP). See below picture.
Thank You all for attending my PowerShell Working with .NET PSObject session. Here’s is my full presentation with all the PowerShell scripts I meant to cover. Please feel free to try them out. During our session I was able to cover only one of the three Excel PowerShell sample.
Thank You Kieser University for having us!
As I look for a way that I could eliminate a single or a range of elements, I found many C# .NET code on how do it. But only one of the answer in many caught my eye. This answer was “System.Collections.ObjectModel.Collection“. This help me search deeper and of course found that there’s a couple of methods I could use if I create my Array as an ArrayList type.
This way I got available two methods I can use: .RemoveAt( element# ) and .RemoveRange( AtElement# , HowMany# ) .
So, in scenario where you want to remove some elements of the array in PowerShell try using the following typed accelerator [System.Collections.ArrayList] .
Here’s a basic sample code:
## - creating your Arraylist .NET object and creates 20 elements:
[System.Collections.ArrayList] $b = 1..20;
## - Here's how you verify the type of object you created:
## - This example will remove Array element #4 and display the results:
## - This example will remove a range of 3 elements starting at element #7:
It’s all part of the beauty of .NET with PowerShell!