Category: powershell

Running a FSIS CTS flow from command line

Posted by – December 21, 2011

FSIS is a powerfull solution, with CTS you can easily consume and process data to be used on ESP for search or not, recently I wrote a very small powershell script that just run a CTS flow to index database records on ESP.

Here’s how this script looks like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Add-PSSnapin HostControllerPSSnapIn
Add-PSSnapin EnginePSSnapin
Add-PSSnapin JunoPSSnapin

write-host "`nRunning flow`n" `
        -foregroundcolor green

Connect-System

Connect-Engine

Execute-Flow -FlowName MyFlow

write-host "`nFinished running`n" `
        -foregroundcolor green

And then I just run the script with:

powershell.exe -Command “& c:\scripts\process_database.ps1″

The above command line example can is ready to be used on Task Scheduler, enjoy!

Share

Checking website status with Powershell

Posted by – July 28, 2011

After few days searching about applications to help me on check is a site is up or not, I finally create my own solution to accomplish this, I wrote a small powershell script to do that.

With few lines of code I would create very quickly a script that just perform a http request and check the return code, if the return is 200, then website is ok, if not, a message will be displayed to the user.

The entire code can be found in below:

More

Share

Getting started with Powershell

Posted by – September 4, 2010

Powershell is an awesome scripting language for Windows machines, last Sunday I wrote a small script to gather computer monitor info stored on windows registry, this is one of the possibilities behind the power of powershell, you can do much more than it.

Here’s a sample script:

1
2
3
4
5
6
7
8
[CmdletBinding(DefaultParameterSetName="Name")]
param (
    [Parameter(Mandatory = $TRUE, ParameterSetName="Name", HelpMessage="Your name")]
    [String]
    $Name
)

write-output "Hello $Name"

More

Share