John Liu Blog

Every drop counts

Reallocate Windows Recovery Partition

After install Window, it will create a recovery partition following the system boot partition. If you want to reallocate the recovery partition, do the following. Disable existing Windows Recovery Partition use command line: reagentc /disable In command line window, run diskpart to remove the recovery partition: list disk select disk # (where # is the disk needing the recovery partition to be removed from. You can use Disk Management to confirm disk #) list partition select partition # (where # is the recovery partition) delete partition override (which will force delete the recovery partition) Now, expand your volume using Disk Management, and leave the similar size (~1024MB or as you see in the above list paritition) at the end of the drive for recreating the recovery partition.

Windows settings - GodMode

On your desktop, create a new folder and using the folliwng whole string, include dot and brackets, as the folder name. Now the folder icon will be change from folder icon so are chart type icon. If you double click the icon, it will open up the folder with almos all the windows settings you can access to. GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

PowerShell File Format Conversion

PowerShell has function to convert files between different formats. To convert Json to CSV: $procs = Get-Content -Path c:\temp\test.json | ConvertFrom-Json $procs | ConvertTo-Csv -Delimiter "`t" -NoTypeInformation | Out-File c:\temp\test.csv If the Json is nested $procs = Get-Content -Path c:\temp\test.json | ConvertFrom-Json $procs.Table1 | ConvertTo-Csv -Delimiter "`t" -NoTypeInformation | Out-File c:\temp\Table1.csv $procs.Table2 | ConvertTo-Csv -Delimiter "`t" -NoTypeInformation | Out-File c:\temp\Table2.csv

PowerShell script to update hosts file

You may need to add computer entery into hosts file for easy RDP access. Run following PowerShell script in administrator mode to add the target machine/IP into hosts file. Or you can manually open the C:\Windows\System32\drivers\etc\hosts file and edit it. #Run this script in Administrator mode cls $Srv = Read-Host -Prompt "Target Server Name" $IP = Read-Host -Prompt "Target Server IP" $newEntry =$IP + " " + $Srv $hostfile = Get-Content C:\Windows\System32\drivers\etc\hosts [bool]$Update = 0 if (-NOT ($IP | Select-String -Pattern "[0-9]+\.

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.