We are, for now, just using the official github copilot CLI, but they didn't really have hooks for PowerShell, so I wrote a few functions to implement it.
It works great, as you can see:
We are, for now, just using the official github copilot CLI, but they didn't really have hooks for PowerShell, so I wrote a few functions to implement it.
It works great, as you can see:
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 |
#require -version 5.1 | |
#Usage: iwr https://tinyurl.com/VSCodeServer | iex | |
#Parameterized usage: & ([ScriptBlock]::Create((iwr https://tinyurl.com/VSCodeServer))) -Your -Options | |
param( | |
#Path to install the vscode binary to. This defaults to a folder in your Local AppData path. Must be writable by your current user without sudo | |
[ValidateNotNullOrEmpty()] | |
[string]$InstallPath = $(Join-Path -Path ([System.Environment]::GetFolderPath('LocalApplicationData')) -ChildPath 'vscode-cli'), | |
#Installation architecture. This is normally autodetected. | |
$Arch, | |
$OS, |
#requires -version 7 -module Microsoft.Graph.Applications | |
using namespace Microsoft.Graph.PowerShell.Models | |
using namespace System.Collections.Generic | |
enum MicrosoftGraphServicePrincipalType { | |
Application | |
Delegated | |
} | |
class MgServicePrincipalPermission { |
# When working with large sets of domain names, email addresses, network CIDR ranges, | |
# and IP addresses, the default string/lexical sorting those values is not ideal. | |
# | |
# Sorting numbers as strings which what happens with IP addresses and CIDR rangers | |
# ends up putting "2" after "11" and "22" after "111" for example. | |
# | |
# Similarly with domain names and email addresses, I find that I often want all the | |
# email addresses with the same domain suffix grouped together instead of all the | |
# bob@<domain> addresses together. And I want FQDNs like <blah>.example.com to sort | |
# together instead of all the mail.<domain> values together. |