Monthly Archive

Categories

Monthly Archives: May 2019

WSL improvements

Windows Subsystem for Linux - WSL improvements have been recently announced - https://devblogs.microsoft.com/commandline/

 

WSL 2 is on the way which will allow more Linux apps in WSL including Docker

 

A Linux kernel will ship with Windows especially tuned for WSL 2

 

WSL 2 will be much faster and have full system call compatibility.

 

A new console – now called a Terminal (more Linux terminology) will also become available for WSL, Windows Command prompt and most importantly PowerShell. It’ll feature multiple tabs

 

Windows Terminal will be shipped via the Windows Store  - do I really want to access an online Store for server software?

Modifying hashtables

Saw a question about modifying hashtables. The suggested code seemed like overkill.

The starting point is this hashtable:

$record = @{Name='Joe'; Date='2019-02-01'; Status='Pending'}

 

The updated data is:
$update = @{Name='Joe'; Date='2019-04-01'; Status='Hired'; City='York'; Country='England'}

 

You need to keep the Name and Date from $record. Modify the Status to be that of $update and add the City and County information to record.

Changing status is a simple assignment:

$record.Status = $update.Status

 

Adding the City and County information is done by adding them to the original hashtable.

$record += @{City=$update.City; Country=$update.Country}

 

You can check the results by displaying the hashtable.

 

Technically, you’re creating a new hashtable, adding the information from $record and then the City and Country information but as it stays in the original variable its always referred to as modifying.