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.

PowerShell User Group in Scotland? Register your interest!

PowerShell User Group in Scotland? Register your interest!

The Scottish PowerShell User Group was officially born today! After spending some time reading about all the user groups in the US and in England I thought it was about time we got the same coverage here in Scotland.

As an off / on user of PowerShell since 2011, I’ve found myself living in the command line more and more and loving it. If you’ve read my bio you’ll know I started out on the command line so coming back feels like coming home.

EMET and Windows 10: Is EMET Still Needed?

EMET and Windows 10: Is EMET Still Needed?

Back in February, Microsoft released version 5.5 of the Enhanced Mitigation Experience Toolkit (EMET). This new release gave us official Windows 10 support. But we waited a long time for that support. Windows 10 was available to the masses in July 2015.

But Microsoft has suggested that this new EMET is not necessary for everyone:

EMET was released in 2009 as a standalone tool to help enterprises better protect their Windows clients by providing an interface to manage built-in Windows security mitigations while also providing additional features meant to disrupt known attack vectors used by prevalent malware. Since that time, we have made substantial improvements to the security of the browser and the core OS. With Windows 10 we have implemented many features and mitigations that can make EMET unnecessary on devices running Windows 10.

Reset WSUS Settings And Use Windows Update

Reset WSUS Settings And Use Windows Update

I was recently reminded that my WSUS server is no longer available on the network. The Windows 8.1 tablet couldn’t find it and as a result couldn’t update to Windows 10. This is how I reset WSUS settings on the tablet and used Windows Update for the future.

Removing WSUS settings is easy. You have two options to do so using the Registry or using PowerShell. They both achieve the same thing.