The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,053 other followers

Archive for the ‘Development’ Category

PowerShell: checking minimum version

Posted by jpluimers on 2020/08/13

Nowadays, often your PowerShell code uses features unavailable in older PowerShell versions. When running it on a version that is too old, you usually get an error message, for instance like this:

Unable to find type [Ordered]: make sure that the assembly containing this type is loaded.

Back in the days, this was a new feature introduced in PowerShell 3.0: [WayBack] Use cases of [ordered], the new PowerShell 3.0 feature – Stack Overflow

It is way friendlier to show a message indicating the version is too old in stead of throwing this error.

That’s where the # Requires Version 3.0 directive comes in: [WayBackabout_Requires | Microsoft Docs.

Adding this line to the top of a script gives output like this on a stock Windows 7 SP1 system that has PowerShell 2.0:

# PowerShell -f List-Delphi-Installed-Packages.ps1
The script ‘List-Delphi-Installed-Packages.ps1’ cannot be run because it contained a “#requires” statement at line 1 for Windows PowerShell version 3.0. The version required by the script does not match the currently running version of Windows PowerShell version 2.0.
+ CategoryInfo : ResourceUnavailable: (List-Delphi-Installed-Packages.ps1:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ScriptRequiresUnmatchedPSVersion

Note that PowerShell 3.0 is also the minimum version for debugging it in Visual Studio Code (which means you do not have to use PowerShell ISE any more; it is still there , but so far behind as a development tool that many prefer Visual Studio Code):

–jeroen

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

PowerShell: finding WSD printer details enumerating through HKLM\SYSTEM\CurrentControlSet\Enum\SWD\DAFWSDProvider

Posted by jpluimers on 2020/08/13

WSD seems the way Microsoft Windows 8+ does printing, which makes it a lot harder to find the IP address of a printer, for instance to configure a Mac to print to it.

The key seems to be enumerating over HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SWD\DAFWSDProvider.

Some links that should help me doing this:

–jeroen

Posted in Development, PowerShell, Scripting, Software Development | Leave a Comment »

A load on agility related posts referenced by Markus Eggers – Google+

Posted by jpluimers on 2020/08/13

A while ago, Markus Eggers – Google+ started following me on G+, so I found out about his posts: most of them refer to very useful agility related ones.

So my reading list just got a bit longer, with tuples on Markus Eggers – Google+ and where it points to.

Other interesting posts:

–jeroen

Posted in Agile, Conference Topics, Conferences, Development, Event, Software Development | Leave a Comment »

Roderick Gadellaa auf Twitter: “@ingnl Ik begrijp dat jullie gaan stoppen met TAN codes. Juich ik toe, 2FA met sms is behoorlijk lek. Maar nu moet ik jullie app gaan gebruiken. Ik werp 1 blik op de permissions die jullie app wil en denk: Neen.…”

Posted by jpluimers on 2020/08/12

[WayBackRoderick Gadellaa auf Twitter: “@ingnl Ik begrijp dat jullie gaan stoppen met TAN codes. Juich ik toe, 2FA met sms is behoorlijk lek. Maar nu moet ik jullie app gaan gebruiken. Ik werp 1 blik op de permissions die jullie app wil en denk: Neen.…”

Reminder to self: check what permissions are needed now.

–jeroen

Read the rest of this entry »

Posted in Development, Power User, Security, Software Development | Leave a Comment »

PlantUML – Visual Studio Marketplace

Posted by jpluimers on 2020/08/12

This and built-in markdown support made the switch to Visual Studio code from Atom.io so much easier: [WayBack] PlantUML – Visual Studio Marketplace.

Atom.io was already on my list of tools to say good bye to: though a good project to show the versatility of the Electron Framework, over time – like Google Chrome – it had become a memory and CPU hog and a drag to use and update.

Integrating debuggers and other parts of the development life cycle involved too much fuzz, for which Visual Studio code (also known as vscode) was much easier from the start.

Probably Visual Studio code did not suffer from what the Dutch call Law of the handicap of a head start: it is much more responsive and versatile than Atom.io. Also the plugins – despite having come to the market later – feel way more mature in Visual Studio code than Atom.io.

Finally, the PlantUML support extension for vscode is so much nicer than in Atom.io, it for instance supports live updating and in addition to local rendering, rendering through a PlantUML server (see [WayBack] GitHub – plantuml/plantuml-server: PlantUML Online Server).

Source code is at [WayBack] GitHub – qjebbs/vscode-plantuml: Rich PlantUML support for Visual Studio Code.

Read the rest of this entry »

Posted in Atom, Development, Power User, Software Development, Text Editors, Visual Studio and tools, Visual Studio Code | Leave a Comment »

 
%d bloggers like this: