This file contains hidden or 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" ?> | |
<!-- ******************************************************************* | |
This is Joel "Jaykul" Bennett's coloring format file for PowerShell 5.1 | |
******************************************************************** --> | |
<Configuration> | |
<SelectionSets> | |
<SelectionSet> | |
<Name>FileSystemTypes</Name> | |
<Types> | |
<TypeName>System.IO.DirectoryInfo</TypeName> |
This file contains hidden or 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
#requires -RunAsAdministrator | |
<# | |
.Synopsis | |
Creates (or alters) a "code" command for opening Visual Studio Code (or VS Code Insiders) | |
.Description | |
Recreates the "code.cmd"" batch file command that starts Visual Studio Code (or VS Code Insiders) | |
1. Adds logic to make it open in the current folder if you don't pass parameters. | |
2. Makes "code" work as a command in Windows 10 Explorer's address bar. | |
#> | |
[CmdletBinding()] |
This file contains hidden or 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
#----------------------------------------------------# | |
# Decrypts password using Certificate | |
#----------------------------------------------------# | |
function Get-DecryptedPassword | |
{ | |
[CmdletBinding()] | |
param | |
( | |
$EncryptedPassword, | |
$EncryptedKey, |
This file contains hidden or 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
if ([Environment]::OSVersion.Version.Major -lt 10) | |
{ | |
Write-Error "Windows 10 or above is required to run this script" | |
exit -1 | |
} | |
Add-Type -Language CSharp -TypeDefinition @' | |
using System; | |
using System.Runtime.InteropServices; | |
using System.ComponentModel; |
This file contains hidden or 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
#! "netcoreapp2.0" | |
#r "nuget: NetStandard.Library, 2.0.0" | |
# [bpm@Orfgum] c:~/playground/c>sudo du -k ~ | dotnet script ./duSort.csx > joy | |
using System; | |
using System.Text.RegularExpressions; | |
using System.Collections.Generic; | |
using (var stdin = new StreamReader(Console.OpenStandardInput())) |
This file contains hidden or 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
#Thread-safe data structure to store prompt strings and communicate about state | |
$prompt = [Collections.Concurrent.ConcurrentDictionary[String,String]]@{} | |
$prompt.infix = '' | |
Set-PSReadlineOption -ExtraPromptLineCount 1 # For 2-line prompt | |
Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -Action { | |
if($prompt.state -eq 'rerender') { | |
$prompt.isIdleRender = 'yes' | |
[Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt() | |
$prompt.isIdleRender = 'no' |
OlderNewer