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,949 other followers

Archive for the ‘Windows’ Category

Windows 10 22H2 ISO download hashes

Posted by jpluimers on 2022/12/02

Since [Wayback/Archive] Download Windows 10 Disc Image (ISO File) hides this only to after you download, below is the complete list of Windows 10 22H2 ISO hashes.

For your convenience, Microsoft did not put it in alphabetic order (for instance, Dutch comes after Norwegian). For a few I downloaded I have added the ISO filenames (which for your convenience too is not included by Microsoft). Oh: note that “English” without any marker means “US English” (which has non-metric defaults, non-ISO page sizes, and odd date formats).

BTW: I wonder if there is a link for Windows 11 Disk Image (ISO File) as https://www.microsoft.com/en-us/software-download/windows11ISO gives a 404 error.

Read the rest of this entry »

Posted in Power User, Windows, Windows 10 | Leave a Comment »

I switched from SysInternals’ TcpView to NirSoft’s CurrPorts (cports)

Posted by jpluimers on 2022/11/18

I was a long time user of SysInternalsTcpView, but a while back I switched to NirSoft‘s CurrPorts (cports).

The main reason is that TcpView does not support filtering, which in the long past was not a problem since few Windows applications keep TCP connection open.

But nowadays with so many network dependencies, especially when using cloud services like DropBox/OneDrive/GoogleDrive/backblaze, these clutter the view a lot.

NirSoft’s CurrPorts (actually the executable is called [Wayback/Archive] cports.exe) can filter for both inclusion/exclusion on the open ports list based on many parameters (search for the “Using Filters” section in the cports.exe documentation: it’s a little bit below the version history).

The filtering syntax is extensive, and for ease of use, the context menu of the open ports list allows adding include/exclude filters on various parameters. After doing that, you can inspect the filter list to get an idea of possibilities and syntax.

For me, the easiest way to install CurrPorts is through [Wayback/Archive] Chocolatey Software | CurrPorts 2.65.

I found CurrPorts when trying to figure out how to use filters in TcpView: [Wayback/Archive] tcpview filter by process – Google Search

–jeroen

Posted in Chocolatey, NirSoft, Power User, SysInternals, Windows | Leave a Comment »

Installing vscode extensions from within the Visual Studio Code terminal was way easier than I anticipated

Posted by jpluimers on 2022/11/09

Having missed quite a lot of Visual Studio Code releases during my metastasised rectum cancer treatment and recovery, it had become both very mature, but also very reliant of having the right extensions installed.

In that period, the extension marketplace grew remarkably, so I really wanted an easy way to install them from within the inside vscode integrated Windows Terminal.

A while ago I wrote How can you export the Visual Studio Code extension list? (via: Stack Overflow), which generated a small script with code --install-extension <extension-name> lines so I could executed those from the command-line for Visual Studio installations on new machines.

Boy was I surprised that you can just as well execute them from the [Wayback/Archive] Integrated Terminal in Visual Studio Code as well (:

When doing so, the Visual Studio Code instance around that Integrated Terminal will automatically pick up the new extension.

I found that with a [Wayback/Archive] vscode install extension from within visual studio code console – Google Search and bumping in the video also embedded below the signature: [Archive] VS Code tips — Installing extensions from the command line using –install-extension – YouTube.

The video also showed that the installation syntax can also include the version number like this:

Read the rest of this entry »

Posted in Console (command prompt window), Development, Power User, Software Development, vscode Visual Studio Code, Windows, Windows 10, Windows Terminal | Leave a Comment »

Reminder to self: check to see the state of winget and if it is possible to install Windows Store applications from the command-line

Posted by jpluimers on 2022/11/02

While undergoing many treatments against rectum cancer, I saved the below tweets with a marker “The new windows package manager: aka.ms/winget“.

[Wayback/Archive] aka.ms/winget

Well, actually the first tweet is gone, now, but archived as [Wayback/Archive] Stefan Stranger on Twitter: “New Windows Package Manager #MSBuild2020… “

Read the rest of this entry »

Posted in Chocolatey, Power User, Scoop, Windows, Windows 10, winget | Leave a Comment »

PowerShell: working around Get-NetFirewallRule not showing all the fields that Set-NetFirewallRule allows you to set

Posted by jpluimers on 2022/10/26

With APIs, you always hope that Get and Set methods mirror each other. More often than not, they don’t.

Take for instance these two:

They are far from symmetric: [Wayback/Archive] Get-NetFirewallRule shows far less than [Wayback/Archive] Set-NetFirewallRule allows you to set (first and foremost the various port related properties). It can be worked around though.

There are a few posts discussing this, of which I think these two are the most important:

Both above posts via [Wayback/Archive] “Get-NetFirewallRule” “LocalPort” – Google Search.

This is what I was after:

PowerShell "Get-NetFirewallRule -Name 'RemoteDesktop-UserMode-In-TCP' | Select-Object Name,DisplayName,Enabled,Direction,@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}},Action,@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}}"

Or actually:

PowerShell "Get-NetFirewallRule -Name 'RemoteDesktop-UserMode-In-TCP' -ErrorAction SilentlyContinue | Select-Object Name,DisplayName,Enabled,Direction,@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}},Action,@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}}"

Let me explain this:

  1. Get-NetFirewallRule gets a firewall rule with a specific name, but can only get you a few properties that can be set through Set-NetFirewallRule. Name,DisplayName,Enabled,Direction are properties it understands. Protocol and LocalPort aren’t, but are often of interest.
  2. Get-NetFirewallPortFilter can get you both Protocol and LocalPort.
  3. There are more functions named like Get-NetFirewall*Filter, all of which require an -AssociatedNetFirewallRule <CimInstance> (or an -All) parameter which is what Get-NetFirewallRule returns. This way you can retrieve details not provided by Get-NetFirewallRule.
  4. The portions like @{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}} returns one property, in this case the Protocol property from Get-NetFirewallPortFilter returned as Protocol (the latter can be different if you want; the former needs to be Protocol).
  5. The -ErrorAction SilentlyContinue bit is to prevent this kind of exception when no -Name matches:
    Get-NetFirewallRule : No MSFT_NetFirewallRule objects found with property 'InstanceID' equal to
    'RemoteDesktop-UserMode-In-TCP_'.  Verify the value of the property and retry.
    At line:1 char:1
    + Get-NetFirewallRule -Name 'RemoteDesktop-UserMode-In-TCP_'
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (RemoteDesktop-UserMode-In-TCP_:String) [Get-NetFirewallRule], CimJobExc
       eption
        + FullyQualifiedErrorId : CmdletizationQuery_NotFound_InstanceID,Get-NetFirewallRule
    When the exception occurs, the execution continues, but since no object is returned the | pipe will not execute and no details are returned.

    I got this trick from [Wayback/Archive] firewall – How can I stop the Powershell command `Get-NetFirewallRule` from throwing an error? – Stack Overflow (thanks [Wayback/Archive] Pure.Krome and [Wayback/Archive] arco444)

Notes:

  • 3. also allows Get-NetFirewallRule to search for a group, then get all the firewall rules out of them, for instance with
    Get-NetFirewallRule -DisplayGroup "File and Printer Sharing" | ForEach-Object { Write-Host $_.DisplayName ; Get-NetFirewallAddressFilter -AssociatedNetFirewallRule $_ }
  • 4. also works the other way around, but only if you have elevated using an administrative token. The below lists all firewall rules involving port 3389 (Remote Desktop Protocol):
    PowerShell "Get-NetFirewallPortFilter | Where LocalPort -eq 3389 | Get-NetFirewallRule"

    Even a plain Get-NetFirewallPortFilter will get you an error without elevation:

    Get-NetFirewallPortFilter : Access is denied.
    At line:1 char:1
    + Get-NetFirewallPortFilter
    + ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : PermissionDenied: (MSFT_NetProtocolPortFilter:root/standardci...tocolPortFilter) [Get-Ne
       tFirewallPortFilter], CimException
        + FullyQualifiedErrorId : Windows System Error 5,Get-NetFirewallPortFilter

You might want to return more details than just Protocol and Localport, so I dug around and made the below table to document the asymmetry.

Read the rest of this entry »

Posted in CommandLine, Development, Power User, PowerShell, PowerShell, Remote Desktop Protocol/MSTSC/Terminal Services, Scripting, Software Development, Windows | Leave a Comment »

 
%d bloggers like this: