Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
ninmonkey / Invoke-PipelineExample-Part1.ps1
Last active December 28, 2021 21:01
Visualizing Powershell's Pipeline
function doIt {
<#
.synopsis
visualize pipeline
.example
.link
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7#-outbuffer
#>
param(
[object]$InputObject,
@ninmonkey
ninmonkey / Show-XmlPreview.ps1
Last active January 27, 2022 17:03
Show-XmlPreview
function ConvertTo-RegexLiteral {
<#
.synopsis
sugar to quickly escape values to thier regex-literal
.description
.example
$PS> Relit 'something'
.example
$pattern = re 'something' -AsRipGrep
rg @('-i', $Pattern)
@ninmonkey
ninmonkey / using CSS selectors in Power BI.md
Last active December 14, 2021 00:01
using CSS selectors in Power BI.pq

New Date.FromText feature

Recently they added a custom date format strings. ( They've had format strings on ToText ) Now they have format strings on FromText )

let
    dt =  DateTime.FromText("2001-01-01T05:09:23",
        [Format = "yyyy-MM-ddTHH:mm:ss", Culture = "en-us"])
in
 dt
@ninmonkey
ninmonkey / Powershell Documentation Examples.readme.md
Last active November 30, 2021 02:40
Powershell Documentation Examples.md
#requires -version 7.2
using namespace system.collections.generic
using namespace system.reflection
function record {
param (
[Parameter(Mandatory)][String]$Name,
[Parameter(Mandatory)][hashtable]$Properties,
[switch]$ReadOnly
)
@ninmonkey
ninmonkey / Powerquery WebRequest Simple.pbix
Last active January 28, 2025 07:48
Viewing HTTP Status codes and error response in Power Query / Power BI
@ninmonkey
ninmonkey / What-Not-To-Do-Pwsh.ps1
Created October 5, 2021 03:17
What-Not-To-Do-Pwsh.ps1
function FooScriptBlock {
<#
#>
[CmdletBinding(PositionalBinding = $false)]
param(
#
[Parameter(Position = 0)]
[string]$Name,