September 30, 2017 at 11:34 am
Comments posted to this topic are about the item Get-DbaPowerShell
October 2, 2017 at 6:45 am
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; Theyll drag you down to their level and beat you with experience
October 2, 2017 at 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.
October 2, 2017 at 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.
October 2, 2017 at 10:49 am
kevin77 - Monday, October 2, 2017 9:59 AMMost 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.
October 2, 2017 at 11:05 am
chrisn-585491 - Monday, October 2, 2017 7:31 AMWe 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.
October 2, 2017 at 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.
October 2, 2017 at 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.
October 2, 2017 at 11:36 am
ZZartin - Monday, October 2, 2017 11:22 AMkevin77 - 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.
October 2, 2017 at 2:02 pm
kevin77 - Monday, October 2, 2017 9:59 AMMost 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
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
October 2, 2017 at 8:03 pm
Steve Jones - SSC Editor - Monday, October 2, 2017 10:49 AMkevin77 - Monday, October 2, 2017 9:59 AMMost 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.
You've just described some of the misgivings that I have for PoSH. π
--Jeff Moden
Change is inevitable... Change for the better is not.
October 3, 2017 at 2:15 am
Jeff Moden - Monday, October 2, 2017 8:03 PMSteve Jones - SSC Editor - Monday, October 2, 2017 10:49 AMkevin77 - Monday, October 2, 2017 9:59 AMMost 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.
You've just described some of the misgivings that I have for PoSH. π
I don't use PoSH much.
I have one SQL job that uses it.
Recently decided to use it in a .NET library to do data transformation of different formatted flat files into a common format. This enabled me to create new transformations using one script and one row in a database table.
Far away is close at hand in the images of elsewhere.
Anon.
October 3, 2017 at 6:58 am
Here is where I've found PowerShell particularly useful:
- Iterating across multiple servers. In my case that's hundreds of servers.
- Integration with Windows, things like gathering disk space and other system information.
- Automated installation scripts.
- File and operating system processing, as a replacement for MS-DOS batch files.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
October 3, 2017 at 8:13 am
Eric M Russell - Tuesday, October 3, 2017 6:58 AMHere is where I've found PowerShell particularly useful:
- Iterating across multiple servers. In my case that's hundreds of servers.
- Integration with Windows, things like gathering disk space and other system information.
- Automated installation scripts.
- File and operating system processing, as a replacement for MS-DOS batch files.
That's mostly where I see it being used well.
October 3, 2017 at 11:16 am
Sadly my most recent foray into powershell was to do a rename of a tree in the file system. The shell was very very slow.
This has been a multiyear project, but I'm hopeful that I'll find a place for it yet. I went to SQL Saturday last Saturday and Allen White (https://twitter.com/SQLRunr) did a great job of showing how to do collect a baseline with Powershell. ( http://www.sqlsaturday.com/636/Sessions/Details.aspx?sid=67890 )
412-977-3526 call/text
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply