Friday 26 February 2010

PowerShell - my first steps

So I asked this question on ask.sqlservercentral.com/questions and the concensus of opinion seems to be that PowerShell should be in my future. I have a few books that I am deciding between but have downloaded some eBooks and have installed some new applications. It was a real hassle getting PSv2 installed as it seems to conflict with PSv1. I have downloaded PowerShell Analyzer from Shell Tools and it works very well. Rather than just the PS command line you get a full IDE that gives a lot of support to a person new to PS.

As a small nugget of what I have covered so far have this little section of Powershell code:

Get-Process *sql* Select-Object name, CPU, virtualmemorysize

This will bring a list of processes on the local machine that have "sql" in their name, their CPU usage and the virtualmemory they are using.
Which for me tells me this:







NameCPUVirtualMemorySize
------------------------
RedGate.SQLBackup.UI184.125272957440
RedGate.SQLPrompt.TrayApp3.6875187170816
SQL Response Client413.03125223125504
SQLAGENT 48.1875138895360
sqlbrowser0.04687514163968
sqlservr2198.968751570562048

neat huh?

No comments:

AddThis

Bookmark and Share
 
Google Analytics Alternative