Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
ninmonkey / DynamicColors-UsingMeasures-PowerBI.md
Last active May 29, 2022 18:06
DynamicColors-UsingMeasures-PowerBI.md

Colors in Power BI

Static

[ Static Alpha Hsla ] :=
    "hsla(219, 68%, 20%, 0.5)"
[ Static Alpha RGBA ] := 
@JustinGrote
JustinGrote / Select-StringMatch.ps1
Last active August 19, 2024 19:01
A companion to Select-String to more easily retrieve the results of capture groups, similar to $matches but pipeline friendly.
filter Select-StringMatch {
<#
.SYNOPSIS
A companion to select-string to quickly fetch the value of a capture group, named or indexed
.DESCRIPTION
With -replace or -match we have the simple $matches['group'] syntax, but this doesn't really exist for Select-String
and the typical options are not pipeline friendly. The default object returned from Select-String is not that friendly
either if all you want is the value(s) of a capture group to then pipe to another command. This is basically a pipeline
friendly version of $matches.
@ninmonkey
ninmonkey / heirarchy.md
Last active September 28, 2022 20:25
mermaid-test.md
classDiagram
class Shape{
    <<interface>>
    noOfVertices
    draw()
}
class Color{
    <<enumeration>>
 RED
@ninmonkey
ninmonkey / Excel_Tabular_Related-FileFormat_Info.md
Last active May 29, 2022 18:06
Excel_Tabular_Related-FileFormat_Info.md
@dfinke
dfinke / getreport.ps1
Last active July 15, 2024 06:11
Retrieve issues from one or more repos, exports it to Excel, then pivots on the repo name, open/closed state, and does a count
Get-GHIssueReport 'powershell/powershell','powershell/vscode-powershell','PowerShell/PowerShellEditorServices' -NumberOfPages 3
@Jaykul
Jaykul / WslHelper.psm1
Last active September 24, 2024 21:15
Some functions I wrote to fix WSL problems
function ConvertFrom-IniContent {
<#
.SYNOPSIS
Parses content from ini/conf files into nested hashtables.
.EXAMPLE
Get-Content \\wsl$\Ubuntu\etc\wsl.conf | ConvertFrom-IniContent
.EXAMPLE
ConvertFrom-IniContent (Get-Content ~\.wslconf -Raw)
.EXAMPLE
"
@StartAutomating
StartAutomating / UsefulAttributes.md
Last active August 7, 2024 01:04
Potentially Useful Attributes in PowerShell

PowerShell, as a language, is very self-discoverable.

When you Get-Command, you get a rich object about a command.

This can have a lot of metadata.

You can and should also use inline help (like this script does).

Sometimes, I want more metadata than the command or parameter can actually provide.

@JustinGrote
JustinGrote / Split-Verbose.ps1
Created February 10, 2022 21:40
Similar to -WarningVariable parameter but also supports filters for verbose output
using namespace System.Management.Automation
using namespace System.Collections.Generic
function Split-Verbose {
<#
.SYNOPSIS
Services a similar purpose to the cmdletbinding WarningVariable parameter but for verbose.
.NOTES
In order for this to work your previous command must have 4>&1 at the end of the command prior to piping to this
#>
[CmdletBinding()]
@JustinGrote
JustinGrote / ExoHttpClient.ps1
Last active July 10, 2024 18:42
Fetch Exchange mailboxes via REST API in parallel using Async and HttpClient
using namespace Microsoft.Exchange.Management.AdminApiProvider
using namespace Microsoft.Exchange.Management.ExoPowershellSnapin
using namespace System.Collections.Generic
using namespace System.Net.Http
using namespace System.Net.Http.Headers
using namespace System.Threading.
<#
I made this as a way to overcome some limitations with very complicated filter queries that exceed the REST limit, while being able to run them in parallel without resorting to runspaces
#>