John Liu Blog

Every drop counts

VS Community 2019 Installer

Microsoft now only support download of the latest VS Community edition from its website. If you need older version of the Community edition, following PowerShell script will help (for VS2019 Community, chage the url for other version might work). You can skip the step D part if don’t want the entire offline installer to be downloaded. CLS # A) Specify the download URL for the Visual Studio 2019 Community edition offline installer $url = "https://aka.

Hyper-v: Convert Generation 1 VM to Generation 2 VM

If you have VM in Generation 1 format, you might want to convert it to Generation 2 format to utilise new futures. For example, Windows11 requires the VM in Gen2 format to be able to enalbe Secure Boot and Trusted Platform Module (TPM). To check if your VM is Gen1 or Gen2, run following PowerShell command. Get-VM | select vmname, generation We can’t directly convert Gen1 VM to Gen2 VM.

Install Python Library in Visual Studio Code

In Visual Studio Code Python project, you can create a Python virtual environment for your project. Open Command Palette (Ctrl+Shift+P), search for Pyton: Create Environment command. This will auto set the workspace environment to the newly created virtual environment. Now in the terminal, run the pip install for the library needed. pip install <library> Alternativly, you can run following script to create the virtual environment (named venv or whatelse you prefer):

Power Automate notes

Add newline to string variable using concat There are several ways to Add a newline when appending to string variable: Add ‘Enter’ into the expression. concat(‘Line1’,’ ‘,‘Line2’,’ ‘,‘Line3’ ) Create a ‘NewLine’ variable and in the ‘Value’ field press Enter to assign line return to it. Use this variable in the concatenation. Use decodeUriComponent(‘%0A’) expression concat(‘Line1’,decodeUriComponent(’%0A’),‘Line2’,decodeUriComponent(’%0A’),‘Line3’) Remove newline from string There seems no easy way to remove newline/line break from multiline string.

Power Automate with Snowflake

Configuration There is a Snowflake connector in Power Platform to connecto to Snowflake database using Snowflake API calls. To be able to use the Snowflake connector, Azure AD (Entra ID) authentication for Snowflake needs to be setup on Snowflake side. Follow Getting started with Power Apps and Snowflake on how to configure the Azure AD authentication for Snowflake. timestamp value In Snowflake Power Platform connector, the timestamp_ntz data type represents a timestamp in UTC time zone without time zone offset information.