Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

PowerShell Basics Expand / Collapse
Author
Message
Posted Saturday, January 22, 2011 11:59 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 843, Visits: 2,324
Comments posted to this topic are about the item PowerShell Basics

Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1051981
Posted Monday, January 24, 2011 7:39 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, June 17, 2011 7:14 AM
Points: 16, Visits: 166
Thanks Shawn. I have yet to use Powershell but this article has been a timely prompt.


Post #1052360
Posted Monday, January 24, 2011 9:19 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:10 AM
Points: 128, Visits: 357
Thanks for the article Shawn. This is really helpful, I appreciate all the links you've provided as well.



Adam Sottosanti
Post #1052469
Posted Monday, January 24, 2011 9:37 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 843, Visits: 2,324
parcival (1/24/2011)
Thanks Shawn. I have yet to use Powershell but this article has been a timely prompt.

Thanks, I wish my current job required me to use it more than I do.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1052492
Posted Monday, January 24, 2011 9:40 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 843, Visits: 2,324
Adam Sottosanti (1/24/2011)
Thanks for the article Shawn. This is really helpful, I appreciate all the links you've provided as well.

You are welcome...here is one I left out cause I did not know if the link would stay active or not:
Bing Visual Search - PowerShell

If the link does not work, just go to http://www.bing.com search for just "PowerShell". You should see a tab show up under the search box called "Visual Search". It is a cool little graphical tool Bing created to browse the major commands and show some syntax.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1052495
Posted Monday, January 24, 2011 12:44 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 7:10 PM
Points: 1,786, Visits: 1,111
Shawn:
Thanks for the great article.
Post #1052636
Posted Friday, February 22, 2013 6:36 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, April 10, 2014 12:47 PM
Points: 153, Visits: 168
Nice introduction to PowerShell! For a bit more geared toward those interested in SQL Server and PowerShell, I wrote a two-part introduction entitled Practical PowerShell for SQL Server Developers and DBAs that shows, among other cool features, how to navigate in "SQL space" just like you can navigate in a file system. See https://www.simple-talk.com/sql/database-administration/practical-powershell-for-sql-server-developers-and-dbas-%E2%80%93-part-1/
Post #1423021
Posted Monday, February 25, 2013 9:03 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, April 19, 2013 8:44 AM
Points: 45, Visits: 283
Nice article, I'm a recent fan of PowerShell. I didn't know about the ISE. I found a use for it beyond metrics and administration that other DBA's might find useful: data traffic. I route a large chunk of our EDI traffic (text files mostly) into filetables with it. The script opens the file, reads what it needs, makes the necessary db calls, logs it, and moves it to point B. In the past I would have considered a CLR routine, but now I find myself asking myself if I can do it in PowerShell first.
Post #1423647
Posted Thursday, June 5, 2014 6:35 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, June 5, 2014 12:21 PM
Points: 78, Visits: 193
following the logic that "the only dumb question is the one which doesn't get asked"-- how do you start Powershell? from SSMS, cmd prompt?
Hey, you said "basic". That's where I'm at.

Thanx!








Wallace Houston
Sunnyland Farms, Inc.

"We must endeavor to persevere."
Post #1577736
Posted Thursday, June 5, 2014 10:56 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 3:47 PM
Points: 843, Visits: 2,324
Caruncles (6/5/2014)
following the logic that "the only dumb question is the one which doesn't get asked"-- how do you start Powershell? from SSMS, cmd prompt?

It can differ a bit based on Operating System where within the start menu you find "PowerShell" to open it. As well, in some instances you want to start PowerShell "as Administrator" to have an elevate privileges within the PowerShell prompt.

Basic:
To just open PowerShell prompt (powershell.exe):
- Start Menu, just type "PowerShell" for Windows 7 and onwards (including Server 2008 and up), this brings up the list for the ISE and just prompt both (x86) and x64 if you are on 64-bit server.

To open SQL Server PowerShell (sqlps.exe):
- Start Menu, just type "sqlps.exe". You generally will not see to many folks use this method.
- Within SSMS 2008 or higher, right-click a folder or container and click "Start PowerShell".
Note that using sqlps.exe you are not in the full blown "Powershell" world, you enter into SQL Server's made up world so to speak. The basic to understand is that general PowerShell commands may not work as you thing they should. This is because of the provider you are in within that particular prompt.

Open SQL Server PowerShell from PowerShell.exe:
- This is the most common method found and a bit easier to work in.
- Within PowerShell prompt for SQL Server 2008 - SQL Server 2008 R2 you type: Add-PSSnapin *SQL*
- Within PowerShell prompt for SQL Server 2012 and up you type: Import-Module SQLPS

If you are at the basics I would start by reading through this guide, even though it is version 1.0 it covers the basics of how PowerShell operators.
Then I would highly suggest watching the beginner PowerShell videos from MidnightDBAs, how I got started in it all.


Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Post #1577935
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse