Archive

Posts Tagged ‘Using ScriptExplorer’’

Script Explorer for PowerShell

March 14, 2012 Leave a comment

Script Explorer

Why am I writing about Script Explorer?

Because I got to play with it when it was more concept than product.

image

This is something that the Scripting Guys already talking about.  Now so can I.  I’ve been a part the CAB for Script Explorer and have tried it’s various iterations.  Joshy has been very responsive and kudos out to Mr. Kelly at MS.  So, this will be in my typical fashion.  I’m going run through it, kick the tires and light the fires.

I installed it over the top of another version to see how it was going to play with a previous release and if a hiccup happens…

I was presented with the typical Repair/Uninstall message.  Since this is checking the clean up I went with uninstall.  Once that completed and the install was done I got the new program indicator and:

image

SNAGHTML248a703

Then I started to look around, clicked a buttor or two:

SNAGHTML24ad40c

Hey, looks like good stuff.  I randomly clicked Browse Categories and Apps, and got right to the scripts. Well, one of the items that ScriptExplorer (SE) does is integrate with the PowerShell ISE.  Guess that’s next.

image

Sure enough.  Already integrated but does it work?

image

Leads to:

SNAGHTML2640d64

Bing Search vs Script Explorer

Many technical questions are answered by searching through major search providers.  For this quick test, I chose Bing to go up against ScriptExplorer.  The scenario is that I need to find some scripts to work with the Web Front End of SharePoint.  So, the stage is set and I want to see the results.  First I’ll start out with a simple search string “SharePoint WFE”.  Pretty open right?

With “SharePoint WFE” in the Search Box in Script Explorer only 41 results were returned.  That’s a pretty targeted list.

SNAGHTML266021e

This included Bing, PoshCode and TechNet in the search.

image

So, to compare, it’s off to Bing.

image

So, just typing in “SharePoint WFE” in BING is not very useful and returned the expected mega-million number of results.  A set by and large to big to just scroll through.   But Search is all about the request, so, time to reformat the question.  To be fair to Bing, ScriptExplorer is already looking for PowerShell Scripts exclusively.

Entered: “SharePoint WFE PowerShell Scripts”

The results were a little better.  Down from 5.96 million results to only 29k.  Still a bit a large list but with more filtering, I can probably scope it down further.  There’s enough to get started.

The abstracts are similar (Bing):

image

To this from ScriptExplorere:

image

Right away, I get to see much more information about what the script does.  Continuing on through the Bing to Technet connection I get:

image

Download link and all.  So, using Bing the basic steps are:

  1. Putting in a correctly formatted search request –> this may take several trys to pare down the list to a manageable number.
  2. Getting a lot of results to scan through—> evening after carefully filtering results, you still will have a large list.
  3. Landing on a page that requires further action to get the content

Back to ScriptExplorer

Remember, both started with the Query String SharePoiint WFE

So here we have the same script:

image

When Selected, I get two options (Save/Insert).

image

Clicking save presents a warning:

SNAGHTML26ed2c5

After accepting the license agreement you get:

SNAGHTML2704ed7

And then you are presented where to locate it.

SNAGHTML2714bac

Now I went back and clicked insert and ended up with the script inserted right into my PowerShell ISE

image

Seems like there was a lot of commentary in the script but certainly not in the inserted piece.  So I opened up the downloaded file (stored in C:\Users\<UID>\Documents\Microsoft Script Explorer\

# ——————————————————————
# Title: PowerShell script for monitoring SharePoint WFE’s and SQL Server back-ends
# Author: Margriet Bruggeman
# Description: You may find that this gallery upload is more than you think (wasn’t that the slogan of Office once?). Choosing the correct set of performance counters for monitoring SharePoint WFE’s and back-ends is a daunting task, and this is my attempt.
#
# Date Published: 11/16/2011 9:09:06 PM
# Source: http://gallery.technet.microsoft.com/scriptcenter/PowerShell-script-for-59cf3f70
# Tags: PowerShell SharePoint 2010 monitoring
# Rating: 3.625 rated by 8
# ——————————————————————

get-counter -counter (get-content mycounters.txt) -MaxSamples 100 -sampleinterval 5 | export-clixml test.xml

So to recap Script Explorer:

  1. Presents detailed information about the script
  2. Simple process to download
  3. Search both local and network resources
  4. Can either store a local copy with all the comments or inserts a minified script into the ISE
Advertisements