PowerShell.org https://powershell.org Thu, 28 Jul 2016 10:23:01 +0000 en-US hourly 1 https://wordpress.org/?v=4.5.3 Deploying Modules to the PowerShell Gallery https://powershell.org/deploying-modules-to-the-powershell-gallery/ https://powershell.org/deploying-modules-to-the-powershell-gallery/#respond Wed, 27 Jul 2016 00:38:35 +0000 https://powershell.org/?p=48382

Related posts:

  1. Continuous Integration, Continuous Delivery, and PSDeploy
  2. Writing and Publishing PowerShell Modules
  3. Episode 299 - PowerScripting Podcast -Warren Frame on Invoke-Parallel and PoshRSJob
]]>
So! We've talked about continuous integration and deployment with PSDeploy, the importance of abstraction, and a bit on how and why to write and publish PowerShell modules.

It's time to combine these ingredients with a quick, real-world walk through on automatically publishing your PowerShell modules to the PowerShell Gallery.  If you want a full run-down showing how to deploy PSDeploy with PSDeploy, hit the link; otherwise, we'll pick up the PSStackExchange module where we left off, and drop in some continuous integration and deployment goodness!

Is everything in order?

First things first, what do we already have?

That's about it!  This is all you need to start automatically publishing to the PowerShell Gallery.

Manual steps

There's one manual step to take - we'll use AppVeyor's secure variables feature to encrypt our PowerShell Gallery API key under our AppVeyor account.

Chris Wahl has a quick hit with instructions.  Long story short? Click your AppVeyor account drop down, Encrypt data.  Paste in your API key and Encrypt!  Copy out the resulting encrypted value.

Okay, now what do we do with it?

Drop in the scaffolding!

We're going to download four files and substitute in our encrypted data.  You could use the code below with a few substitutions to add automated deployments to your PowerShell modules:

# Create a folder, clone PSStackExchange, browse to that repo
# Substitute in values for your own module as desired
$Repo = 'C:\sc\PSStackExchange\'
mkdir C:\sc
cd C:\sc
git clone https://github.com/RamblingCookieMonster/PSStackExchange.git
cd $Repo

# We're in the repo! Download 4 scaffolding files:
$wc = New-Object System.Net.WebClient
'https://raw.githubusercontent.com/RamblingCookieMonster/PSDeploy/8b83d7a4e068b08be3293281b3d2c88c9ccd8c16/appveyor.yml',
'https://raw.githubusercontent.com/RamblingCookieMonster/PSDeploy/8b83d7a4e068b08be3293281b3d2c88c9ccd8c16/build.ps1',
'https://raw.githubusercontent.com/RamblingCookieMonster/PSDeploy/8b83d7a4e068b08be3293281b3d2c88c9ccd8c16/psake.ps1',
'https://raw.githubusercontent.com/RamblingCookieMonster/PSDeploy/8b83d7a4e068b08be3293281b3d2c88c9ccd8c16/deploy.psdeploy.ps1' |
    ForEach-Object {
        $File = Join-Path $Repo ($_ -split "/")[-1]
        $wc.DownloadFile( $_, $File )
    }

# Replace my encrypted NuGetApiKey with yours!
$YourKey = 'SomeEncryptedKeyFromAppVeyor'  # <<<<<< Replace this with your encrypted data from AppVeyor <<<<<<
$AppVeyorPath = Join-Path $Repo appveyor.yml
$AppVeyorContent = Get-Content $AppVeyorPath -Raw
Set-Content $AppVeyorPath -Value $AppVeyorContent.replace('secure: oqMFzG8F65K5l572V7VzlZIWU7xnSYDLtSXECJAAURrXe8M2+BAp9vHLT+1h1lR0', "secure: $YourKey")

# Commit your changes, push them to GitHub, and you're good to go!

I made these changes, pushed to GitHub with !Deploy in my commit message, and voila!  AppVeyor ran the build, and PSStackExchange was updated in the gallery!

Wait, what does this all mean?

So! Every time I make a change to PSStackExchange going forward, I have the option to say !Deploy anywhere in my commit message.  When that happens, my changes run through Pester tests in AppVeyor, and are automatically pushed to the PowerShell Gallery in the unlikely event that I didn't make a mistake.

  • Someone submits a bug report and I have a fix to add?  Automatically !Deploy
  • Someone submits a pull request with an awesome new feature?  Automatically !Deploy
  • I discover I've made a terrible mistake and need to re-write something?  Automatically !Deploy
  • I'm literally too lazy to run a single command, with a key I could serialize using the DPAPI?  !Deploy

Okay, to be fair, this pipeline borrows from the PowerShell team and deploys developer builds to AppVeyor regardless of whether you say !Deploy.

More specifically:

  • AppVeyor reads the appveyor.yml, which tells it to run the build.ps1
  • The build.ps1 downloads a few modules, sets some build variables, and runs psake.ps1
  • Psake.ps1 includes our steps to test via Pester, build via BuildHelpers (bump the module version, etc.), and deploy via PSDeploy
  • Deploy.psdeploy.ps1 tells PSDeploy what to deploy, and includes some gates - for example, only deploy the master branch to the PowerShell gallery

That's about it!

Takeaways

Three quick takeaways:

(1) Each of the components in this pipeline, and the pipeline itself are open source:  psake, Pester, PSDeploy, and BuildHelpers.  Feel free to contribute ideas, bug reports, tests, documentation, code, and the like.

(2) It goes without saying, but do consider writing modules, open sourcing them, and publishing them to the PowerShell Gallery - ideally automatically with something like the process we just walked through!

(3) This is a great way to get your feet wet with release pipelines for infrastructure.  You might have different tests, and you might deploy systems and services rather than modules, but ultimately:

  • You're pushing changes to source control
  • You have a build system that watches this, and...
    • Runs a suite of tests
    • Perhaps "builds" some artifacts you need
    • Pushes out your changes.  Perhaps to production

Cheers!

]]>
https://powershell.org/deploying-modules-to-the-powershell-gallery/feed/ 0
Every pithy witticism begins with quotation marks https://powershell.org/every-pithy-witticism-begins-with-quotation-marks/ https://powershell.org/every-pithy-witticism-begins-with-quotation-marks/#respond Sat, 23 Jul 2016 22:56:52 +0000 https://powershell.org/?p=48025

Related posts:

  1. Documenting your PowerShell API--solved!
  2. Complete Guide to PowerShell Punctuation
  3. New PowerShell.org Visual Design Draft, Pt 2
]]>
"To be or not to be". Without getting into a debate over whether Shakespeare was musing about being a logician, suffice to say that in writing prose, the rules of when and how to use quotation marks are relatively clear. In PowerShell, not so much. Sure, there is an about_Quoting_Rules documentation page, and that is a good place to start, but that barely covers half the topic. It assumes you need quotes and then helps you appreciate some of the factors to consider when choosing single quotes or double quotes.

But do you need quotes? Remember PowerShell is a shell/command language so "obviously" you can do things like this:

PS> Delete-Item C:\tmp\foobar.txt
PS> Get-ChildItem *.log
PS> Get-Process svchost, conhost, powershell

It would certainly be cumbersome if you needed to quote each of those arguments, so PowerShell was designed well, in that respect.

But what if you ran the same commands just slightly differently?

PS> "C:\tmp\foobar.txt" | Delete-Item 
PS> "*.log" | Get-ChildItem 

Here you must use quotation marks or you will suffer the wrath of a terminating error from the PowerShell host most certainly!

Those are just a couple of the many examples I consider in When to Quote in PowerShell. Accompanying the full article, I also included a wallchart that condenses all the article's salient points into a single-page reference. Here's a fragment of the wallchart:

Guide to PowerShell Quoting wall chart

Read the article and download the wallchart here.

]]>
https://powershell.org/every-pithy-witticism-begins-with-quotation-marks/feed/ 0
MSPSUG July 12th Virtual Meeting: Exploring SQLPS, the SQL Server PowerShell Module https://powershell.org/mspsug-july-12th-virtual-meeting-exploring-sqlps-the-sql-server-powershell-module/ https://powershell.org/mspsug-july-12th-virtual-meeting-exploring-sqlps-the-sql-server-powershell-module/#comments Mon, 11 Jul 2016 18:21:52 +0000 https://powershell.org/?p=46503

Related posts:

  1. MSPSUG Feb 9th Virtual Meeting: Intro into the #PowerShell ISE, #Git, #PSPester & #OneDrive
  2. #MSPSUG Virtual Meeting: The Art of #PowerShell Runspaces – September 8th 2015
  3. MSPSUG June 14th Virtual Meeting: Pester the Tester PowerShell Bugs Beware!
]]>
Join the Mississippi PowerShell User Group virtually on Tuesday, July 12th 2016 at 8:30pm Central Time when Mike Fal will be presenting “Exploring SQLPS, the SQL Server PowerShell Module”.

A big hurdle for using PowerShell and SQL Server together is the SQLPS module. Both old and new users of PowerShell don’t completely understand its capabilities. In this session, we’ll talk about the cmdlets you may not know about, tricks to save time using the provider, and even a few gotchas on how the provider works that can save you some time and energy. When we’re finished, you will have a deeper understanding of how you can use SQL Server and PowerShell together.

Visit the Mississippi PowerShell User Group website to learn more about Mike and to find out more details about this month’s meeting.

The Mississippi PowerShell User Group Meetings are held online (via Skype for Business) on the second Tuesday of each month at 8:30pm Central Time and are free to attend. The system requirements to attend these online meetings can be found on the MSPSUG website under the “Attendee Info” section.

Register via EventBrite to receive the URL for this meeting.

Note: It is not necessary to live in Mississippi or join our user group to attend our meetings or present a session for our user group.

µ

]]>
https://powershell.org/mspsug-july-12th-virtual-meeting-exploring-sqlps-the-sql-server-powershell-module/feed/ 1
Finding PowerShell Sessions At Conferences and Events https://powershell.org/finding-powershell-sessions-at-conferences-and-events/ https://powershell.org/finding-powershell-sessions-at-conferences-and-events/#respond Fri, 01 Jul 2016 13:20:03 +0000 https://powershell.org/?p=45481

Related posts:

  1. Get-PSUGUK now also in London - November 26th
  2. When Will There be a PowerShell Summit in ____?
  3. PowerShell Summit N.A. 2014 Financial Report
]]>
The Current State

So! If you visit the PowerShell.org events page, you'll find a bevy of PowerShell-focused events, from local PowerShell user groups to global PowerShell conferences.

What you won't find, yet, is a list of PowerShell related sessions at the many other conferences and user groups you might consider attending.

Maybe you'd like to find PowerShell oriented sessions at non-PowerShell user groups and mini conferences like SQL Saturdays, VMUGs, Azure User Groups, Security BSides, DevOpsDays, etc.  These are great small events that can build your knowledge, help you meet local folks in a particular field, and often provide provide you with some free food.

Beyond these, there are plenty of summits and conferences that have a strong PowerShell track, or even just a handful of awesome PowerShell sessions, that might be worth knowing about. LISA, DerbyCon, MMS, WinOps, TechMentor, and many more.

How do you find these events?  There isn't a solid option today, but hopefully we can change that.  Before we go further though, why is this even helpful?

Why?

This might be silly, but I tend to gravitate towards PowerShell oriented sessions at non-PowerShell-focused events.  If someone is using PowerShell to work with a particular technology, chances are they will be good folks to learn from.

On top of this, your local user group leaders would have details on folks they could potentially ping and enlist for an in-person session, or even just an informal geek dinner.

Finally, it might help you find events worth attending.  If you want a comprehensive list of tech conferences and events, there isn't really a solid directory, let alone one what will help you find PowerShell oriented sessions.

What Can I Do?

If you think this would be worthwhile, you can help make it happen!

Are you giving a PowerShell oriented session?  Is it on PowerShell.org's event page? Go ahead and add it! Try to keep in line with their policy of including nonprofit, not-for-profit, or otherwise noncommercial events, but thankfully most tech events fit the bill.

Here's a quick example:

  • Event Name: Event Name: Session title
  • When: Specific start and stop time for the one session
  • Where: Address for the event
  • Details: Abstract for the session, ideally mentioning who will be presenting

Once you've filled it out, it might look like this.

If you know of a session that isn't listed, feel free to pester the presenter and to point them at this post - the earlier they get it on the calendar, the better!  If you have the session details and can't get in touch with the presenter, feel free to add the session yourself.

Cheers!

 

]]>
https://powershell.org/finding-powershell-sessions-at-conferences-and-events/feed/ 0
To ping or not to ping..The PowerShell way https://powershell.org/to-ping-or-not-to-ping-the-powershell-way/ https://powershell.org/to-ping-or-not-to-ping-the-powershell-way/#comments Mon, 27 Jun 2016 20:29:29 +0000 https://powershell.org/?p=44970

Related posts:

  1. Getting your Script Module functions to inherit "Preference" variables from the caller
  2. How "Quick and Dirty" Becomes "Permanent and Annoying."
  3. 2016-January Scripting Games Wrap-Up
]]>
As this is my first blog here, here’s a bit about me. I’m a current lead SCCM Admin in the UK, and have found this great enjoyment for PowerShell in the last 18 months. I’ve started my own blog, http://www.get-configmgr-content.co.uk/, to share my passion. The chance to blog on Powershell.org was too exciting not to do!

The inspiration for this blog came from a forum post on Powershell.org that I helped contributed on. The question asked was, how to display the name of failed ping, i.e. $computer is offline.
There were some great responses, the one I most liked which I slightly amended into a function was:

function test-ping { $args | % {[pscustomobject]@{online = test-connection $_ -Count 1 -quiet;computername = $_}} }

The simplicity and power is brilliant. (Credit to Dan Potter!)

I expanded on this and came up with a way to use the results in several different ways. All this by the power of advanced functions.
I have two advanced functions 'ValueFromPipeline' and 'ValidateSet' in this script:
1. 'ValueFromPipeline' gives the capability to pass more than one object to our script. Perfect for passing one or many devices.
Other than the message "Online: PC1", I wanted to be able to use the ping status to pass to another cmdlet, collate all online or offline devices and display the results in a table.

2. Using 'ValidateSet' I could define my options, "Online","Offline" and "ObjectTable". But by not setting the parameter to mandatory, you don’t have to use the additional options.
To continue using the ping response, I needed to hold them somewhere. I did this by creating an empty array in the Begin block and append each ping response to it.
Regardless of what option I choose, if any, the below block of code will always run:

$device| foreach {
            if (Test-Connection $_ -Count 1 -Quiet) {
                if(-not($GetObject)){write-host -ForegroundColor green "Online: $_ "}
                    $Hash = $Hash += @{Online="$_"}
            }else{
                if(-not($GetObject)){write-host -ForegroundColor Red "Offline: $_ "}
                    $Hash = $Hash += @{Offline="$_"}
                }
        }

Devices in the variable, $device, will each be 'pinged' then passed through a 'if' statement depending on offline or online status and get added into the $hash array variable.
DISCLAIMER: I should apologies to Don here for killing the puppies with write-host. I wanted to just push out some colored output to the host only!

Before I go any further, let me briefly explain how I am 'pinging' the devices. I am using the cmdlet 'Test-Connection'. The synopsis on 'get-help' for test-connection states, 'Sends ICMP echo request packets ("pings") to one or more computers.' A nice feature of this cmdlet is the '-quiet' syntax. This is cool as it gives a Boolean result (True or False) of the 'ping' status. By adding a '-count' as well I can limit the number of times I request a connection check. Now I can pass as many devices through the pipeline to my function and get an online or offline message pretty quickly.

The second half of the script only runs if you add the '$getObject' option from the function. The use of the 'validateSet' allows me to make sure the three options I defined are used only.
The data collected in the $hash array variable is passed through a foreach statement and creates customobjects. The final part is use of a 'Switch'. Depending on what was chosen in the $getObject parameter is the output at the end of the script.
The advantage to this switch is I can pass all the online PC's to something else via the pipeline. For example, an AD group or a deployment collection:

'PC1','PC2' | Get-PingStatus -GetObject Online | # pass to another cmdlet 

Capture the 'online' PC's to a variable and use:

$Online = 'PC1','PC2' | Get-PingStatus -GetObject Online

Or if you need to report back a list of PC's which are either on or offline in an object group:

'PC1','PC2', 'PC3','PC4 | Get-PingStatus -GetObject objectTable

DeviceName Online offline
---------- ------ -------
pc4        Online
pc1               Offline
pc2               Offline
pc3               Offline

Again this script has great flexibility in how you pass the device objects.
Say you have a list of PC's in a txt for CSV file, you can use Get-content and pipe it to Get-PingStatus:

get-content pcs.csv | Get-PingStatus

NOTE:
The use of the $Global: variable allowed me to use $Global:Objects once the script has complete. Just something I thought could be useful. The $Script: variable would have worked fine should I not want to use the variable outside the script.

I hope you've enjoyed my blog and I welcome any comments. I've posted the script on GitHub should you wish to download.
https://github.com/Gbeer7/GetPingStatus.git

The full script:

Function Get-PingStatus
 {
    param(
        [Parameter(ValueFromPipeline=$true)]       
        [string]$device,
        
        [validateSet("Online","Offline","ObjectTable")]
        [String]$getObject
    ) 

begin{
    $hash = @()

    }
process{
    
    $device| foreach {
            if (Test-Connection $_ -Count 1 -Quiet) {
                
                if(-not($GetObject)){write-host -ForegroundColor green "Online: $_ "}
                    
                    $Hash = $Hash += @{Online="$_"}
            }else{

                if(-not($GetObject)){write-host -ForegroundColor Red "Offline: $_ "}
                    
                    $Hash = $Hash += @{Offline="$_"}
                }
        }            
    }

end {
    if($GetObject) {
 
            $Global:Objects = $Hash | foreach { [PSCustomObject]@{
                
                DeviceName = $_.Values| foreach { "$_" }
                Online     = $_.Keys| where {$_ -eq "Online"} 
                offline    = $_.Keys| where {$_ -eq "Offline"} 
                }
            }   

    Switch -Exact ($GetObject)
        {

            'Online'      { $Global:Objects| where 'online'| select -ExpandProperty DeviceName }
            'Offline'     { $Global:Objects| where 'offline'| select -ExpandProperty DeviceName }
            'ObjectTable' { return $Global:Objects }       
        }

    }       
  } 
}
]]>
https://powershell.org/to-ping-or-not-to-ping-the-powershell-way/feed/ 4
Here's What You've Missed at PowerShell.org (and what's coming) https://powershell.org/heres-what-youve-missed-at-powershell-org-and-whats-coming/ https://powershell.org/heres-what-youve-missed-at-powershell-org-and-whats-coming/#comments Fri, 24 Jun 2016 17:19:59 +0000 https://powershell.org/?p=44731

Related posts:

  1. Follow Up Survey About Azure Access Control Service
  2. The New PowerShell Community
  3. PowerShell Summit... EUROPE?!?!?
]]>
We've been making a ton of improvements at PowerShell.org... if you haven't visited in a while, it might be worth a stop by.

First, if you're hitting any of the links below and getting a 404, the most common culprit seems to be an over-zealous corporate proxy cache. Try clearing it, or doing a Shift+Reload in your browser. Confirm by visiting from a non-proxied network, like at home.

Our eBooks page has a bunch of new content, and our books are now available in PDF, MOBI, and EPUB from two providers (LeanPub and GitBook). You can also read books online in HTML.

Site members now have an extensive profile that you can complete, and doing so is one step on our short Welcome Aboard! mission that will earn you a new "Welcome!" badge on the site. It's one of many new achievements you can earn for participating in the community in a variety of ways.

And have you seen our new videos? In addition to tons of YouTube videos that include workshops, tutorials, and Summit recordings, we also have started new short-subject, structured learning series - entire courses that even award a certificate of completion when you're done!

But there's much more we can do to help you connect with community, so we're taking a quick survey. Here's some of what we can enable:

  • Friend Connections. Kinda like Facebook, enabling you to track on-site activity of the people you "follow."
  • Private Messages. Just what it says - everyone would have a mailbox inside PowerShell.org.
  • Activity Streams. Similar to a Twitter or Facebook feed, a way of seeing site activity (with its own RSS). Threaded comments, @mentions, and email notifications, too.
  • User Groups. The ability to create in-site groups with their own discussion forum, activity stream, and shared content.
  • REST API. A way of communicating with WordPress via REST calls, to retrieve or check content.

Visit the survey to let us know which ones you'd want, or don't care about.

And drop a comment below if there's something else you'd like to see or share!

]]>
https://powershell.org/heres-what-youve-missed-at-powershell-org-and-whats-coming/feed/ 2
High-Level: Designing Your PowerShell Command Set https://powershell.org/high-level-designing-your-powershell-command-set/ https://powershell.org/high-level-designing-your-powershell-command-set/#respond Mon, 20 Jun 2016 10:27:41 +0000 https://powershell.org/?p=43864

Related posts:

  1. How to Name Your Help Files
  2. A Helpful Message about HelpMessage
  3. Command and query separation in Pester tests
]]>
So you've decided to write a bunch of commands to help automate the administration of ____. Awesome! Let's try and make sure you get off on the right path, with this high-level overview of command design.

Start with an inventory

You'll need to start by deciding what commands to write, and an inventory is often the best way to begin. Start by inventorying your nouns. For example, suppose you're writing a command set for some internal order-management system. You probably have nouns like Customer, Employee, Order, OrderItem, CustomerAddress, and so on. Write 'em all down in an Excel spreadsheet, one noun per row.

Then inventory your verbs. For each noun, what can you do with it? For example, you can probably create orders, so a New-Order command will be needed. Make a "New" column in your spreadsheet, and put an "X" in the row next to the Order noun. However, you probably can't remove an order from the system, so although your spreadsheet might have a "Remove" column to cover things like Remove-Employee, that column won't get an "X" in the Order row. Orders might be voidable, though, so what's a good verb for that? https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx has the official verb list, but there's no "Void" or "Cancel" that seems appropriate. Don't go making up new verbs!!! Instead, it might be that Set-Order could be the answer, enabling approved changes to orders, including cancelling them (but retaining the record).

Finally, pick a prefix for your nouns. If your order system is named "Order Awesomeness," then maybe OAwe is a good noun prefix, as in Set-OAweOrder. The prefix will help keep your command names from bumping up against other people's, so making sure that noun prefix is pretty unique... is pretty important.

Design individual commands

Now it's time to start designing individual commands. This is usually a kind of iterative process, meaning you'll go back and change your mind, expand, and so on a few times before you're done.

Start by writing examples of how each command will be used to accomplish whatever tasks you'll be accomplishing. Save these examples, too - they should become examples in your commands' help files. Write as many examples as possible, covering as many situations and needs as you can think of. Enlist users to help.

As you write the examples, try to pay attention to the following:

  • Parameter names should be consistent across the commands. If order objects have an ID, and you need to be able to specify it, then it should be something like -OrderId every time. Don't use -OrderId on some commands and -Id on thers. Also pay attention to what the underlying software objects' property names are. For example, if customer names are exposed through a CustNameFirst and CustNameLast property, consider using those as corresponding parameter names, or at least as parameter name aliases.
  • Start thinking about which parameters are going to be mandatory.
  • Give some thought to different ways that commands might be used, and start denoting those as different parameter sets.

This kind of example-based specification will help you think through how you want the commands to work, and it may highlight cases where you need more commands, where commands may need to be combined, and so on.

Sketch out your help files

Believe it or not, it's not a bad idea to start drafting out your help files at this point. Define parameter sets, parameters, and examples. Briefly describe what each parameter is for - you can always make the language nicer and more formal later, so just a brief draft should work at this point. This kind of forces you to think through how your commands will work, and how other people will end up approaching them. It also gives you a good start on writing documentation! "Documentation as specification" helps a lot of people write specs that can end up being repurposed as docs, killing two birds with one stone.

Define expected results

Go back to your examples, and provide some examples of the results you'd expect to see if you actually ran those commands as shown in your examples. This helps you to start defining the tests that you'll run against your code. "For this command, we should get this output" is exactly what testing is all about. "This command should generate this error, this command should do this," and so on.

Start coding

With some good design work out of the way, you can start coding. Not just your commands, mind you, but also the Pester tests you'll use to validate those commands. Code 'em at the same time, if you like, and use those tests in unit testing as you work.

]]>
https://powershell.org/high-level-designing-your-powershell-command-set/feed/ 0
Help Me Test SSL on PowerShell.org https://powershell.org/help-me-test-ssl-on-powershell-org/ https://powershell.org/help-me-test-ssl-on-powershell-org/#comments Mon, 13 Jun 2016 14:02:17 +0000 http://powershell.org/?p=42717

Related posts:

  1. Site Migration Status / Known Issues
  2. Problems with Windows Live Logins
  3. Achievements
]]>
I'd appreciate your help in testing HTTPS/SSL here on PowerShell.org. Right now, it's "voluntary," meaning you have to explicitly ask for https://powershell.org. If you have any problems, please note them in a comment on this article.

Some notes and known problems:

  • Most pages will not show the "lock" address bar icon in your browser, because we're delivering mixed content. For example, the site logo is being hardcoded as http:// by some Javascript in our theme, which I need to sort out.
  • Your connection will be to CloudFlare, which is who issued the certificate you'll see. We've also SSL'd the traffic between them and our server using a DigiCert SSL certificate. We're also going to enable client certificate authentication, so our server will only deliver content to CloudFlare, which then delivers it to you. That's ahead.

I think we can solve the mixed-content problem by forcing HTTPS, which is easy, but I want to make sure it's otherwise working before taking that step. We already have a WordPress plugin in place that's rewriting http:// or https:// with just // in URLs, but there're a couple of places where that plugin isn't able to help, and that's why we're delivering mixed content still.

I'll point out that this is mainly a bonus-points project; because almost everyone logs into the site using an external account, we don't store many passwords (and thus don't transmit them in the clear or otherwise). We don't store or transmit any other personally identifiable information. Still, SSL has some other benefits, and it shouldn't hurt to have it on, so we're giving it a shot.

Thanks!

UPDATES 15 June 2016

  • The Lock icon in browser address bars should be working; we've fixed the mixed-content issues I've found.
  • We're forcing HTTPS.
  • We use CloudFlare; you're getting SSL from you to them, and they're getting (forced) SSL from them to us.
  • We're getting an "A" from SSLLabs and SecurityHeaders.io - thanks for that suggestion, Paal. CloudFlare doesn't let us implement every security header yet, but we've got most of the recommended ones.
]]>
https://powershell.org/help-me-test-ssl-on-powershell-org/feed/ 17
Complete Guide to PowerShell Punctuation https://powershell.org/complete-guide-to-powershell-punctuation/ https://powershell.org/complete-guide-to-powershell-punctuation/#comments Sat, 11 Jun 2016 22:57:55 +0000 http://powershell.org/?p=42611

Related posts:

  1. Every pithy witticism begins with quotation marks
  2. Announcing - PowerShell Hyper-V CookBook - Free!
  3. Documenting your PowerShell API--solved!
]]>
Quick as you can, can you explain what each of these different parentheses-, brace-, and bracket-laden expressions does?

${save-items}
${C:tmp.txt}
$($x=1;$y=2;$x;$y)
(1,2,3 -join '*')
(8 + 4)/2
$hashTable.ContainsKey($x)
@(1)
@{abc='hello'}
{param($color="red"); "color=$color"}
$hash['blue']
[Regex]::Escape($x)
[int]"5.2"

When you're reading someone else's PowerShell code, you will come across many of these constructs, and more. And you know how challenging it can be to search for punctuation on the web (symbolhound.com not withstanding) !

That is why I put together a reference chart containing all of PowerShell's symbology on one page. making it much easier when you need to look up a PowerShell symbol as you read code--or to browse for the right construct when you are writing code.

PowerShell Punctuation wall chart

Download the Complete Guide to PowerShell Punctuation wallchart from here.

]]>
https://powershell.org/complete-guide-to-powershell-punctuation/feed/ 3
MSPSUG June 14th Virtual Meeting: Pester the Tester PowerShell Bugs Beware! https://powershell.org/mspsug-june-14th-virtual-meeting-pester-the-tester-powershell-bugs-beware/ https://powershell.org/mspsug-june-14th-virtual-meeting-pester-the-tester-powershell-bugs-beware/#comments Fri, 10 Jun 2016 15:47:52 +0000 http://powershell.org/?p=42545

Related posts:

  1. MSPSUG Feb 9th Virtual Meeting: Intro into the #PowerShell ISE, #Git, #PSPester & #OneDrive
  2. MSPSUG May 10th Virtual Meeting: Acceptance Testing PowerShell DSC with Test-Kitchen
  3. MSPSUG July 12th Virtual Meeting: Exploring SQLPS, the SQL Server PowerShell Module
]]>
Join the Mississippi PowerShell User Group virtually on Tuesday, June 14th 2016 at 8:30pm Central Time when Microsoft MVP Robert Cain will be presenting “Pester the Tester: PowerShell Bugs Beware!”.

So you’ve been developing PowerShell for a while, or perhaps you’re taking over maintenance of an existing set of scripts. It would be great to get extra confidence in your scripts through testing, but how? You’re in luck, there’s a new module in town, Pester!

Pester is a friendly testing framework designed for testing your PowerShell scripts and modules. In this session you’ll be introduced to Pester. You’ll see how to use Pester to uncover bugs, as well as using it for test driven development. Make your own PowerShell more robust through the use of Pester. Kill those PowerShell bugs, dead!

Visit the Mississippi PowerShell User Group website to learn more about Robert and to find out more details about this month’s meeting.

The Mississippi PowerShell User Group Meetings are held online (via Skype for Business) on the second Tuesday of each month at 8:30pm Central Time and are free to attend. The system requirements to attend these online meetings can be found on the MSPSUG website under the “Attendee Info” section.

Register via EventBrite to receive the URL for this meeting.

Note: It is not necessary to live in Mississippi or join our user group to attend our meetings or present a session for our user group.

µ

]]>
https://powershell.org/mspsug-june-14th-virtual-meeting-pester-the-tester-powershell-bugs-beware/feed/ 2