The rest of the code is here: Write.Html.pq
// aliases
Write.Format = String.Write.Format,
Write.Element = Write.Html.Element,
Write.Key = Write.Html.KeyValue,
Tag = Write.Html.Element,
function CalcRelativeDays { | |
param( | |
[datetime]$BaseDate, | |
[datetime]$InputDate, | |
# default returns totalDays, this returns the raw [TimeSpan] | |
[switch]$PassThru | |
) | |
if($PassThru){ | |
return ($InputDate - $BaseDate) | |
} |
#Requires -Version 7 | |
using namespace System.Collections.Generic | |
using namespace System.Text | |
using namespace System.Text.Json | |
using namespace System.Text.Json.Serialization | |
$assembly = Add-type -AssemblyName System.Text.Json -PassThru -ea 'stop' | |
function AutoJson { | |
<# |
The rest of the code is here: Write.Html.pq
// aliases
Write.Format = String.Write.Format,
Write.Element = Write.Html.Element,
Write.Key = Write.Html.KeyValue,
Tag = Write.Html.Element,
using namespace System.Collections.Generic | |
Import-module Pansies | |
function Dotfiles.Select-Some { | |
<# | |
.SYNOPSIS | |
select 1 item, 5, or a specific count. | |
.NOTES | |
- [ ] future: rewrite using steppable pipeline for an earlier exit | |
.EXAMPLE |
{ | |
// settings related to pwsh terminal | |
"powershell.enableProfileLoading": true, | |
"terminal.integrated.defaultProfile.windows": "Pwsh🐒", // "Pwsh🐒", | |
// The terminal profile to use for automation-related terminal usage like tasks and debug. This setting will currently be ignored if `terminal.integrated.automationShell.windows` (now deprecated) is set. | |
"terminal.integrated.automationProfile.windows": { | |
"args": [ | |
"-NoLogo" | |
], |
function widget:GetInfo() | |
-- start at: <https://springrts.com/wiki/Lua:Main> | |
-- <https://springrts.com/wiki/Gamedev:Main> | |
return { | |
name = "hiworld", | |
desc = "getting started", | |
author = "ninmonkey", | |
date = "May 10, 2024", | |
license = "GNU GPL, v2 or later", |
-- Widget Custom data and order, order = 0 disabled widget | |
return { | |
allowUserWidgets = true, | |
data = { | |
AdvPlayersList = { | |
absoluteResbarValues = false, | |
alwaysHideSpecs = true, | |
customScale = 0.84999996, | |
enemyListShow = true, | |
expandDown = false, |
#Requires -Version 7.0 | |
Import-Module 'pansies' | |
function Hr { "`n----`n" } | |
<# | |
See related runes: | |
https://www.compart.com/en/unicode/block/U+2580 | |
#> | |
$up = "`u{2580}" <# upper: https://www.compart.com/en/unicode/U+2580 #> | |
$down = "`u{2584}" <# lower: <https://www.compart.com/en/unicode/U+2584> #> |
Import-Module ImportExcel -PassThru | |
Push-Location $PSScriptRoot | |
# Close-ExcelWindow | |
$PSDefaultParameterValues['Export-Excel:Verbose'] = $true | |
$users = @( | |
[pscustomobject]@{ | |
Name = 'Jen' | |
Region = 'Blue' | |
Len = '=LEN( [@[Name]] )' |
# Here's what not to do. I'm testing line continuation grammar | |
$daxStudioOutput = @( | |
'foo has | pipe', 'path \\?\c:\foo', 'other' -join "`t" | |
'PBIDesktopTrace', 'XEvent' -join "`t" | |
'tabularEditor', '96f8cba3-0ecc-4179-b720-e27ba7cef5a' -join "`t" | |
) | Join-String -sep "`n" | |
$renderArray = @{ | |
OutputPrefix = "[`n" | |
OutputSuffix = "`n]" | |
FormatString = "`n`t{0}," |