SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get-DbaPowerShell


Get-DbaPowerShell

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)

Group: Administrators
Points: 249285 Visits: 19809
Comments posted to this topic are about the item Get-DbaPowerShell

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
MyDoggieJessie
MyDoggieJessie
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20888 Visits: 7461
Thanks for the write-up Steve, I’m kind of in the same boat...but I think for me it’s more tnullhat I feel intimidated by that language than anything else!

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
chrisn-585491
chrisn-585491
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5932 Visits: 2649
We are being forced to add PoSh to the daily toolkit by some smarter folks here. I really don't care for the syntax, looks like Perl, DCL and AppleScript had a mutant love child. But since it hooks into SQL Server, it's what we have.
kevin77
kevin77
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2564 Visits: 1116
Most of PowerShell is just wrappers around .NET, so why not just use .NET in the first place. Download VS Code, learn some of the .NET API, and become familiar with the documentation. You'll get a much better IDE environment, namely Intellisense, many more code examples, and integrated source control, to name a few.

I despise PowerShell. I wish Microsoft would have never released it. (Having to deal with the multiple versions of PowerShell was horrible.) It's great to have options and I believe you should use the right tool for the job, but it also causes problems by having too many options and a disparate set of tools.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)SSC Guru (249K reputation)

Group: Administrators
Points: 249285 Visits: 19809
kevin77 - Monday, October 2, 2017 9:59 AM
Most of PowerShell is just wrappers around .NET, so why not just use .NET in the first place. Download VS Code, learn some of the .NET API, and become familiar with the documentation. You'll get a much better IDE environment, namely Intellisense, many more code examples, and integrated source control, to name a few.

I despise PowerShell. I wish Microsoft would have never released it. (Having to deal with the multiple versions of PowerShell was horrible.) It's great to have options and I believe you should use the right tool for the job, but it also causes problems by having too many options and a disparate set of tools.


I'm not sure I think a .NET program by most people will be better written than the PoSh wrappers. I think that's asking for more bugs and trouble, not to mention a much more difficult deployment process than using PoSh.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
ZZartin
ZZartin
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9851 Visits: 12035
chrisn-585491 - Monday, October 2, 2017 7:31 AM
We are being forced to add PoSh to the daily toolkit by some smarter folks here. I really don't care for the syntax, looks like Perl, DCL and AppleScript had a mutant love child. But since it hooks into SQL Server, it's what we have.

Hmm... I'm actually loving powershell, so far I haven't had to actually hook it into SQL Server but from a general batch scripting perspective it's awesome. It has far more power than dos batch commands and isn't limited by being a compiled program.

kevin77
kevin77
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2564 Visits: 1116
...and isn't limited by being a compiled program.


A PowerShell script has many of the same limitations as a compiled program, namely, it requires a specific framework in order to run and run correctly. That is no different than any compiled program.




ZZartin
ZZartin
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9851 Visits: 12035
kevin77 - Monday, October 2, 2017 11:12 AM
...and isn't limited by being a compiled program.


A PowerShell script has many of the same limitations as a compiled program, namely, it requires a specific framework in order to run and run correctly. That is no different than any compiled program.

Requiring a dedicated tool to even see the code, Visual Studio for example, is very limiting. Not to mention that unless you can read binary you have no idea if the source code you're looking at is actually what is running.

That's not to say huge applications should be built in powershell but for basic scripting tasks like file maintenance or simple web service calls it's a very powerful tool that trying to do in C# would be more trouble and ad no benefit.

kevin77
kevin77
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2564 Visits: 1116
ZZartin - Monday, October 2, 2017 11:22 AM
kevin77 - Monday, October 2, 2017 11:12 AM
...and isn't limited by being a compiled program.


A PowerShell script has many of the same limitations as a compiled program, namely, it requires a specific framework in order to run and run correctly. That is no different than any compiled program.

Requiring a dedicated tool to even see the code, Visual Studio for example, is very limiting. Not to mention that unless you can read binary you have no idea if the source code you're looking at is actually what is running.

That's not to say huge applications should be built in powershell but for basic scripting tasks like file maintenance or simple web service calls it's a very powerful tool that trying to do in C# would be more trouble and ad no benefit.

A .cs file can be opened in Notepad and compiled on the command line, which equates to about the same experience you get with PowerShell.
How is executing a binary that you wrote in the past and placed on a server any different than executing a PowerShell script that you wrote and placed on a server? Are you saying that you always review every line of code of a PowerShell file, and understand it, before executing it?

As I said, I do believe in using the right tool for the job. However, if Microsoft would have made PowerShell a "scriptable .NET", the world would have been a much better place.




Eric M Russell
Eric M Russell
SSC-Forever
SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)SSC-Forever (48K reputation)

Group: General Forum Members
Points: 48358 Visits: 12286
kevin77 - Monday, October 2, 2017 9:59 AM
Most of PowerShell is just wrappers around .NET, so why not just use .NET in the first place. Download VS Code, learn some of the .NET API, and become familiar with the documentation. You'll get a much better IDE environment, namely Intellisense, many more code examples, and integrated source control, to name a few.

I despise PowerShell. I wish Microsoft would have never released it. (Having to deal with the multiple versions of PowerShell was horrible.) It's great to have options and I believe you should use the right tool for the job, but it also causes problems by having too many options and a disparate set of tools.

Visual Studio Code, the lightweight cross-platform (win/mac/linux) version of Visual Studio, now has an extension to support PowerShell editing.
https://trevorsullivan.net/2017/02/24/use-visual-studio-code-write-powershell/
https://code.visualstudio.com/docs/editor/whyvscode



"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search