This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace Microsoft.Z3 | |
using namespace System.Collections.Generic | |
using namespace System.Management.Automation.Language | |
function GetZ3Ast([System.Management.Automation.Language.Ast]$ast, $ctx) | |
{ | |
$typeName = $ast.GetType().Name | |
switch ($typeName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([type]$Type) | |
$result = [pscustomobject]@{} | |
foreach ($property in $type.GetProperties([System.Reflection.BindingFlags]::Public -bor [System.Reflection.BindingFlags]::Static)) { | |
$name = $property.Name | |
$params = @{ | |
InputObject = $result | |
MemberType = 'ScriptProperty' | |
Name = $property.Name | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Position=0, Mandatory)] | |
[hashtable] | |
$private:Environment, | |
[Parameter(Position=1, Mandatory)] | |
$private:ScriptBlock | |
) | |
end { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ExecutionContext.InvokeCommand.CommandNotFoundAction = | |
{ | |
param([string]$commandName, | |
[CommandLookupEventArgs]$eventArgs) | |
if ($commandName -match "(.*)=(.*)") { | |
$var = $matches[1] | |
if ($var.StartsWith("get-")) { | |
$var = $var.Substring(4) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Autocompletion for clang - only works in pwsh | |
Register-ArgumentCompleter -CommandName clang -Native -ScriptBlock { | |
param($wordToComplete, $commandAst) | |
if ($wordToComplete.StartsWith('-')) { | |
$p,$a = $wordToComplete -split '=',2 | |
if ($null -ne $a) { | |
$clangArg = "$p=,$a" | |
$type = [System.Management.Automation.CompletionResultType]::ParameterValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:element name="Configuration"> | |
<xs:complexType> | |
<xs:all> | |
<xs:element name="DefaultSettings" type="DefaultSettings" minOccurs="0" maxOccurs="1"/> | |
<xs:element name="SelectionSets" type="SelectionSets" minOccurs="0" maxOccurs="1"/> | |
<xs:element name="Controls" type="Controls" minOccurs="0" maxOccurs="1"/> | |
<xs:element name="ViewDefinitions" type="ViewDefinitions" minOccurs="0" maxOccurs="1"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Out-Default | |
{ | |
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkID=113362', RemotingCapability='None')] | |
param( | |
[switch] | |
${Transcript}, | |
[Parameter(ValueFromPipeline=$true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Reports if your password is pwned by querying haveibeenpwned.com | |
.DESCRIPTION | |
Query haveibeenpwned.com to see if a password has appeared in a breach. | |
The query sends the first 5 characters of the SHA1 hash, so the query should be considered safe and anonymous. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "./FSharp.Data.2.4.3/lib/net45/FSharp.Data.dll" | |
open FSharp.Data | |
let (user,repo) = | |
match fsi.CommandLineArgs with | |
| [| _; arg1; arg2 |] -> (arg1, arg2) | |
| _ -> failwithf "usage: gh user repo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .SYNOPSIS | |
# Print a tree given a key property and parent property | |
# | |
# .PARAMETER InputObject | |
# | |
# The object to print. | |
# | |
# .PARAMETER KeyProperty |
NewerOlder