I Will Be Speaking At The French PowerShell Saturday
Image is courtesy of *Robert*

I Will Be Speaking At The French PowerShell Saturday

It’s been a while since I’ve posted. Work. Life. And speaking. Have all taken it’s toll on my time. It’s always at the back of my mind when I come across a problem, solve it and think ‘hey that would make a good blog post’. And then promptly get wrapped up in something else and that solution never gets shared.

… but that does lead me nicely to my next big knowledge sharing event (it’s like I planned this post!).

How To Fix Slow DNS Response and Page Loading with Hyper-V Default Switch

How To Fix Slow DNS Response and Page Loading with Hyper-V Default Switch

In my move away from VMware workstation I’ve been using Hyper-V more and more for virtual machines but I’ve come across a problem only recently. DNS resolution and internet browsing is noticeably slower with many pages not being able to be viewed at all. So after much frustration I decided to tackle this problem today and I found something unexpected.

Along with the new Fall Creators Update released at the tail end of 2017 is a new Hyper-V NAT switch called Hyper-V (Default Switch). This switch by default takes up an IP address on the 172. network (in my case 172.28.111.0/28) and provides a DHCP service to virtual machines connected to it. So no more static IP configuration. A big plus.

Extract A File Icon Using PowerShell and .NET

Extract A File Icon Using PowerShell and .NET

I’ve been resisting buying a Stream Deck for a while now but finally succumbed to temptation and it arrived today. Setting it up is fairly easy but associating a program with a button does not extract the icon from the executable. So I looked for a way to extract the icon myself. And of course I looked to use PowerShell.

I knew there was a Drawing namespace in .NET so I browsed the latest .NET framework on the MSDN site and found what I was looking for! When looking for information on any .NET classes, methods or properties, the MSDN site is a really good place to start.

Creating Enums In PowerShell

Creating Enums In PowerShell

In a previous blog post I talked about working with enums in PowerShell and how useful they are. Would they not be even more useful if we could create and use our own enums? Yes, yes they would. And if you read below you’ll find out how.

You’ve been able to create enums in PowerShell since v1.0. But since the introduction of PowerShell version 5 there are now two ways:

Working With Enums In PowerShell

Working With Enums In PowerShell

Enums are not a commonly used data type in PowerShell but after using them to force the TLS version that PowerShell would use in the previous blog post, I was reminded of how simple and useful this little used data type really is. Although they have been usable since PowerShell 1.0, they got some love in version 5.

What Is An Enum?

An enumerated type (called an enum for short) defines a set of values and restricts it’s use to those values. Each value is a member of the enum and each member has an associated integer value. The integer value is assigned to the member depending on the order in which it appears in the enum, starting with 0. You can override the integer value associated with a member.

Force PowerShell to use TLS 1.2

Force PowerShell to use TLS 1.2

Recently I’ve begun to move the Chocolatey packages I maintain from manual to automatic updating. Going through each package I came across an issue with Yubico Authenticator while retrieving the downloads page using Invoke-WebRequest yubico-authenticator-ps-error

This caught me by surprise as I was retrieving other Yubico website pages, such as developers.yubico.com, without issue.

I decided to look at the SSL / TLS protocols for the pages using SSL Labs SSL online test and found the following:

Scottish Powershell and Devops User Group June 2017 Meetup

Scottish Powershell and Devops User Group June 2017 Meetup

The third meeting of the Scottish PowerShell User Group will take place on Wednesday 22nd June at our virtual meeting home.

Agenda

  • 7.00pm - Waiting room for networking and general chit chat;
  • 7.10pm - Welcome, events, news and agenda (Paul Broadwith )
  • 7.20pm - Learn PowerShell In A Month Of Lunches Book Review & Questions (Colin Westwater )
  • 7.40pm - ‘Be A Good Coding Citizen’ - Presentation & Questions (Paul Broadwith )
  • 8.45pm - Wrap up chat and close

Have a topic or presentation?

The group is always keen to have speakers, new and experienced, to deliver presentations for us.

Scottish Powershell and Devops User Group May 2017 Meetup

Scottish Powershell and Devops User Group May 2017 Meetup

The second meeting of the Scottish PowerShell User Group will take place on Wednesday 17 May 2017 at our virtual meeting home.

Please find the agenda below along with a few other group updates.

Agenda

  • Group updates and changes (10 minutes);
  • PSConfEU discussion. As some of you know I attended the PSConfEU conference in Germany last week and I’d like to chat about the talks I went to and the information I picked up (20 - 30 minutes);
  • Learn PowerShell In A Month Of Lunches book review. This is the most recommended PowerShell book and Colin Westwater will give his view of the book (10 minutes)

Name Change

As PowerShell, and the group, have a much wider scope than just a scripting language we have renamed it to be PowerShell and Devops User Group - the UK organisation is PowerShell & Devops UK User Group and we are the Scottish PowerShell & Devops User Group (there are also groups in London, Manchester and Southampton). This is not something new as it was always envisaged that the group would encompass Devops (such as DSC etc.), PowerShell (including full and core) and Azure (which encompasses both Devops and PowerShell) and the change is to make it clear what we cover and help people better find us. This list is not exhaustive as there are many more Devops tools and Cloud Platforms but as long as they have a PowerShell leaning they are within the group scope.