The Wiert Corner – irregular stream of stuff

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

  • My work

  • 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 1,811 other followers

Archive for the ‘PowerShell’ Category

How bad is the Windows command line really?

Posted by jpluimers on 2017/04/13

How bad is the Windows command line really?

The Windows command line is bad. Very bad.

But it took until recently for old Windows versions – that out of the box had either no or poor PowerShell versions – to have slowly died.

So only now PowerShell finally has become an option that really works across all Windows versions I use. Go PowerShell!


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

PowerShell: when Format-Table -AutoSize displays only 10 columns and uses the width of the console when redirecting to file

Posted by jpluimers on 2017/03/09

Lets start with the second problem: There are various ways to redirect PowerShell output to a file.

  • Shell redirect with a greater than sign (>) to create/overwrite output or two greater than signs (>>) to append output.
  • Use Out-File [WayBack] with a filename and either -FilePath (default, similar to >) or -Append (similar >>).

I write “similar” as they are not fully equivalent. That’s where Format-Table [WayBack] with the -AutoSize parameter comes in (with or without a -Wrap parameter).

Apart from Format-Table displaying only 10 columns by default (see below), the -AutoSize will change columns presentation depending not just on the -Wrap parameter but also to the total width it thinks it has available.

Useful Format-Table parameters

First the representation:

Read the rest of this entry »

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

Regularly forcing Microsoft Silverlight to be a hidden Windows Update

Posted by jpluimers on 2017/01/03

I got a bit fed-up with the deprecated Microsoft Silverlight reappearing as KB3056819 in each Windows Update within minutes of hiding it (I’m not alone on this, it does this when you have configured to favour the Microsoft Update Servers – that also update Office – in favour of the Windows Update Servers).

Two really odd things:

  1. In the past, I hid “Skype for Windows desktop 7.3 (KB2876229)” which stayed hidden.
  2. I never installed Silverlight, there is no Silverlight on the system (I checked the registry, file system with Everything and more), but the update keeps re-appearing (like KB960353 does for others).

So I wanted a script that every minute could check for a Microsoft Silverlight update, then hide it.

That appeared a lot more cumbersome than I anticipated, hence this blog post.

The reason is that unlike many other operating systems, Windows does not come with a build-in package manager that you can script (there is Windows Installer, but is’s not easily scriptable).

Read the rest of this entry »

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

Determine Domain and username used when a network share was mapped

Posted by jpluimers on 2016/11/15

Need to research this a bit further as this works:

powershell gwmi -Query 'Select LocalName, RemoteName, UserName from Win32_NetworkConnection'
__GENUS : 2
__CLASS : Win32_NetworkConnection
__PATH :
LocalName :
RemoteName : \\w701ujpl\IPC$
UserName : EN81ENTx64SCAN\jeroenp
PSComputerName :

But this fails for some Powershell versions:

gwmi -Query 'Select * from Win32_NetworkConnection' | Select-Object LocalName, RemoteName, UserName, ConnectionState | Sort-Object LocalName | ft -auto


Source: user – Determine Domain and username used to map a network drive – Stack Overflow

Posted in Development, PowerShell, Scripting, Software Development | 1 Comment »

Update to List-Delphi-Installed-Packages.ps1 shows HKCU/HKLM keys and doesn’t truncated fields any more

Posted by jpluimers on 2016/08/24

I’ve posted an update to List-Delphi-Installed-Packages.ps1 that:

  • added HKCU/HKLM registry key values for each BDS version
  • doesn’t truncate fields any more when your console has limited width
  • is now in UTF-8 format so the BitBucket web-interface can show it

For the first two: Phry for helping me to force Format-Table to show more than 10 columns and pointing me how find out how to do this with Out-String so it doesn’t truncate fields; blog post about it will follow.

Now – as I can display more than 10 columns- I can start working in integrating all the other info about various BDS versions.

Source is at

A text dump of the current output is below.


via: If you need to know underlying information on Delphi versions « The Wiert Corner – irregular stream of stuff

Read the rest of this entry »

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

%d bloggers like this: