- currently this requires at least Windows 11 insider beta channel - install guide
- and "adb.exe" must be in your system path - install guide
- download these files to a local folder
- double click the android_subsys_install_apk_context_menu_setup.cmd
*.appx | |
*.msixbundle | |
*.wsb |
<ul> | |
{[1, 2, 3, 4, 5].map(i => <li>{i}</li>)} | |
</ul> |
# C# syntax works under both pwsh core and legacy Windows Powershell which is capped at C# 5.0 and .Net Framework vs dotnet core | |
Add-Type @" | |
using System; | |
using System.IO; | |
public static class BigCsvSplitter | |
{ | |
public static void Run() |
# https://www.nuget.org/packages/Microsoft.Net.Compilers.Toolset | |
md cs-repl | cd | |
nuget install Microsoft.Net.Compilers.Toolset | |
# run a CS script, a useful alternative to PowerShell itself | |
echo 'Console.WriteLine("hello");' > script.csx | |
. (gci -recurse csi.exe).FullName script.csx | |
# run in REPL mode |
# base64 to hex | |
echo -n AwCYPg== | base64 -d | xxd -ps | |
# hex to base64 | |
echo -n 0300983e | xxd -r -p | base64 |
dest.cs | |
dest/ | |
save.ps1 | |
source.cs | |
source.dll |
//helper function | |
function groupBy(objectArray, property) { | |
return objectArray.reduce((acc, obj) => { | |
const key = obj[property]; | |
if (!acc[key]) { | |
acc[key] = []; | |
} | |
// Add object to list for given key's value | |
acc[key].push(obj); | |
return acc; |
///////////////////////////////////////////////////////////////////////////////////////// | |
//first some helper functions to tee up one last clean routine at the bottom | |
//from: https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep/39914235#39914235 | |
const sleep = s => new Promise(resolve => setTimeout(resolve, s * 1000)); | |
//from:https://stackoverflow.com/questions/37576685/using-async-await-with-a-foreach-loop/49432189#49432189 | |
Array.prototype.forEachAsync = async function (fn) { for (let t of this) { await fn(t) } } | |
//get data |
# all syntax is pwsh v7+ compatible | |
########################################### | |
# the basic scenario is wanting to fire another codegen tool whenever `dotnet watch run` reports a change to specific source files | |
# it's very fortunate dotnet watch already reports exactly what we need to trigger on | |
########################################### | |
# this code is very customized to watch my ServiceStack webapi project | |
# and run the ServiceStack CLI tooling that autogens typescript DTOs from C# DTOs. | |
# | |
# i've also tailored to watching for specific errors, and trimming the debug output verbosity and changing console text color to catch the eye |