This is a markdown file.
graph TD;
A(with a mermaid diagram)-->B;
A-->C;
B-->D;
C-->D(embedded inside);
This is a markdown file.
graph TD;
A(with a mermaid diagram)-->B;
A-->C;
B-->D;
C-->D(embedded inside);
#Requires -PSEdition Core | |
# HT @santisq in powershell-slack | |
# https://powershell.slack.com/archives/C1RCWRDL4/p1685120926413089 | |
function foo { | |
param( | |
[Parameter(Mandatory,ValueFromPipeline)] | |
[string] | |
$bar |
function New-DateArray { | |
<# | |
.EXAMPLE | |
$days = New-DateArray '2021-01-01' '2021-02-01' | |
$days | % { $_.ToShortDateString() } | |
#> | |
[CmdletBinding()] | |
Param( | |
[Parameter()] |
I'm attempting (and failing) to run a data-driven Pester v5 test over a PS Class. In the Tests/ directory are the 3 (currently failing) implemetations.
<xsd:schema xmlns:shp="http://schemas.microsoft.com/sqlserver/2004/07/showplan" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
targetNamespace="http://schemas.microsoft.com/sqlserver/2004/07/showplan" elementFormDefault="qualified" | |
attributeFormDefault="unqualified" version="1.539" blockDefault="#all"> | |
<xsd:annotation> | |
<xsd:documentation> The following schema for Microsoft SQL Server describes output from the showplan | |
functionality in XML format. Microsoft does not make any representation or warranty regarding the schema or | |
any product or item developed based on the schema. The schema is provided to you on an AS IS basis. | |
Microsoft disclaims all express, implied and statutory warranties, including but not limited to the implied | |
warranties of merchantability, fitness for a particular purpose, and freedom from infringement. Without |
$ComputerList = 1..4 | ForEach-Object {"node-0${_}"} | |
$LocalHostName = hostname | |
$disks = foreach($computer in $ComputerList){ | |
if($LocalHostName -eq $computer){ | |
Get-PSDrive -PSProvider FileSystem | |
}else{ | |
Invoke-Command -ComputerName $computer{ | |
Get-PSDrive -PSProvider FileSystem | |
} | |
} |
function Merge-ObjectArray { | |
<# | |
.DESCRIPTION | |
Converts an array of objects into a single object with all constituent | |
properties of each input. If a synonymous property is detected between | |
inputs, the value is overwritten and a warning is raised but the merge | |
continues. | |
.EXAMPLE | |
$foo = @{foo=1} |
date +%FT%T%z | |
date +%Y%m%dT%H%M%S%z | |
## 2020-04-30, 11:47: | |
diff <(jq -S . before.json) <(jq -S . after.json) | |
du -h --max-depth 1 | |
stat -f "%SB %Sm %N" -t %Y%m%d%H%M%S /var/db/mongodb/index/* |
#!/usr/bin/env bash | |
# | |
# usage: dot-source to export to the current shell context | |
# . ./gdate_best_date.sh | |
# | |
# remove the override with `unset -f`: | |
# unset -f date | |
# | |
if ! ( date --version 2>&1 | grep GNU > /dev/null ); then |
#!/usr/bin/env pwsh | |
#Requires -Modules AWSPowerShell | |
# TODO: dispose of vars properly... | |
# not sure atm why they persist in caller scope when dot-sourced :\ | |
[cmdletbinding()]param( | |
[Parameter(Mandatory=$true)]$AwsMfaCode | |
,$ProfileName = "default" | |
) | |
$serial_number = (aws sts get-caller-identity --profile $ProfileName --output text --query 'Arn').Replace('user','mfa') |