Showing results for PowerShell_For_Programmers - Scripting Blog [archived]

Jun 19, 2018
0
0

PowerShell For Programmers: Here Strings, There Strings, Everywhere Some String Strings

Kory Thacher
Kory Thacher

There won't be much code in today's post, but this can be a useful feature to know about. In addition to the expandable and literal strings we talked about, we can also use something called a Here String. Here strings allow us to have quote characters inside of our string that match the quote characters we use to create that string. For examp...

PowerShellkorytKory Thacher
May 15, 2018
0
1

Doing more with functions: Verbose logging, Risk mitigation, and Parameter Sets

Kory Thacher
Kory Thacher

Welcome back to PowerShell for Programmers, this week I'm trying gitGist again for the code blocks. Let me know what you think about it vs the normal syntax highlighter I use :) As we've seen in the other posts about functions, attributes are a really cool thing to extend the features we have available to ourselves and for our users. This post i...

PowerShellkorytKory Thacher
Apr 24, 2018
0
0

Doing More With Functions: Comment-Based Help

Kory Thacher
Kory Thacher

I just wanted to throw together a post highlighting how cool and easy it is to add help data to your own Functions and scripts. The help data gets added via comments. For functions the help data can go in three places: For scripts we just put it at the top of your script before you type the param() statement, or at the bottom, b...

korytKory Thacher
Mar 27, 2018
0
1

Doing More With Functions: Taking Parameters on the Pipe

Kory Thacher
Kory Thacher

In an earlier post, I showed you how you could use the [parameter(mandatory)] attribute to force your parameters to behave  a bit more like you'd expect from other languages. We also have a bunch of other useful attributes we can use on our parameters to enable cool features. Pipelineing The pipe might feel pretty magical to you in PowerShell, as...

korytKory Thacher
Mar 14, 2018
0
1

PowerShell for Programmers: The Magic Switch!

Kory Thacher
Kory Thacher

Welcome back everyone, I'm trying out GitHub Gist for my code blocks this week. It lets you click and download them, as well as making them easy to edit. The downside is that I can't use my usual dark themed syntax highlighting. Let me know in the comments if you like gist or the old method better :) Switch statements in PowerShell are very cool...

korytKory Thacher