Saturday, December 6, 2008

using posh to get-sqldata

 Accessing SQL Server Data from PowerShell, Part 1

Accessing SQL Server Data from PowerShell, Part 2 Use ADO.NET to insert, update, and delete data



Parse SQL DataSet to variables in Windows Powershell - scrool 2 end 

Getting Powershell output into a sql table in Windows Powershell  

PowerShell Mini SQL Query Analyzer


how to connect to a SQL database, query the Employees table of the Northwind database, and write those results to the screen.  


Using Powershell to Generate Table-Creation Scripts

Create Your First SQL Server Database in 3 Quick Steps

Accessing SQL Server Data from PowerShell, Part 1



SQL Server PowerShell Overview
get-data from sql start-sql

Quick and Dirty Software Inventory with PsInfo and PowerShell


 executing SQL queries from Powershell in Windows Powershell 


Check your SQL Server using Windows PowerShell –series

If you install the SQL Server 2008 client software, you get a SQL Server
PowerShell snap-in. You can run the sqlps.exe utility that loads the snapin
into a PowerShell environment, or start PowerShell and load in the snap-in
yourself. With the snap-in, you can get a list of the instances on a
computer by:

cd SQLSERVER:\SQL\MyComputerName
dir

Running SQL Server PowerShell:
http://msdn.microsoft.com/en-us/library/cc281954.aspx
Using the SQL Server PowerShell Provider:
http://msdn.microsoft.com/en-us/library/cc281947.aspx

NOTE: the Running SQL Server PowerShell topic still uses the old names for
the snap-in. The next update to Books Online includes an update to the topic
that uses the released names: SqlServerProviderSnapin100 and
SqlServerCmdletSnapin100.
-- 



poshOUT-2-sqlIN 


parse results - scroll 2 end

sharepoint&posh

SharePoint and PowerShell Demo - Part 1
SharePoint and PowerShell Demo - Part 2

Karine Bosch > posh & sharepoint entries

Powershell to control SharePoint

Taming SharePoint -powerGUI

Manipulating remote SharePoint Lists with PowerShell

PowerShell & the SharePoint object model

SharePoint and PowerShell - practical tips


Presention Slides and PowerShell code from UK SharePoint User Group Thursday 26'th October

PowerShell for Flexible Iterative SharePoint-based Development



articles on setting up a sharepoint dev environment:

Using Tools to make SharePoint Development Easier



Powershell + SharePoint

Automating Common SharePoint Tasks with PowerShell





Wednesday, December 3, 2008

profile load issue solved

File C:\Users\Gaurav\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.
At line:1 char:2
+ .  <<<< ‘C:\Users\Gaurav\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1′
This is because PowerShell does not allow the execution of scripts by default. To fix this open PowerShell in Admin mode and set the execution policy to unrestricted by running the following command:

Set-ExecutionPolicy remotesigned
 
Notepad $profile 
Add-PSSnapin Quest.ActiveRoles.ADManagement
Set-ExecutionPolicy remotesigned

Saturday, November 22, 2008

error handeling

Trap [Exception] { “In PowerShell”

Catch-Error.ps1

 

#Requires -Version 2
# Show-TryCatchFinally.ps1
# Demonstrates try/catch/finally in V2
# First, try something that will work
Try {
$I=1
}
Catch {"Caught a problem in try 1"
}
Finally {
"All done with 1st try"
}

# Now try something that fails
$one=1
#$zero=0
Try { $one/$zero}
Catch {"Caught a problem in try 2"}
 

 


Default Error Handling
Error handling in PowerShell scripts
Lunch Lesson: Error Handling in PowerShell

Methods for handling errors in PowerShell can range from simple to complex

for each

  In PowerShell, foreach is both a statement and an alias to the ForEach-Object cmdlet. 

While you might think that both of these examples do exactly the same thing, they do not. 

Powershell tutorial 8 part 1

PowerShell tutorial 8 part 2

Essential PowerShell: Understanding foreach