This example organizes all the non-pbix files in subdirectories.
Imagine main
is a local folder, ex: inside the root folder: `c:\git\PowerQuery
The absolute path to my screenshot is:
c:\git\PowerQuery\img\title.screenshot.png
using namespace System.Collections.Generic | |
Function InvokeGrep { | |
<# | |
.SYNOPSIS | |
wraps the native command RipGrep | |
#> | |
param( | |
[string]$Pattern, |
filter Expand-Property { | |
<# | |
.SYNOPSIS | |
Expands an array property, creating a duplicate object for each value | |
.EXAMPLE | |
[PSCustomObject]@{ Name = "A"; Value = @(1,2,3) } | Expand-Property Value | |
Name Value | |
---- ----- | |
A 1 |
Write-LogMessage Verbose -Message 'stuff' -Json @{ 'user' = 'bob'; id = 100 }
function New-SafeFileTimeNowString {
<#
.SYNOPSIS
timenow for safe filepaths: "2022-08-17_12-46-47Z"
.notes
{
"powershell.startAutomatically": true,
"powershell.enableProfileLoading": true,
"powershell.integratedConsole.showOnStartup": true,
"powershell.integratedConsole.suppressStartupBanner": false,
"powershell.promptToUpdatePackageManagement": false,
"powershell.promptToUpdatePowerShell": false,
using crazy padding as example input
I call it modern
, but it fully works on PS5.1 without changes!
In the examples below, if you add a using namespace
statement, you can remove Systems.Collections.Generic
tip: System
is always included, so you can omit that prefix anywhere as well.
using namespace system.collections.generic
[List[Object]]$users = @()