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
Set-PowerLinePrompt ` | |
-SetCurrentDirectory ` | |
-RestoreVirtualTerminal ` | |
-PowerLineFont ` | |
-FullColor ` | |
-Title { | |
$title = "PowerShell {0} - {1} ({2}) - PID: {3}" -f $PSVersionTable.PSVersion.ToString(),(Convert-Path $pwd), $pwd.Provider.Name,$PID | |
if (Test-Elevation) { | |
"Elevated - $title" | |
} else { |
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
<# | |
Forked from https://github.com/jaykul Gist, posted in response to my Twitter | |
whinge about PowerShellGet in the enterprise - Thank you, Joel Bennett! | |
This adds the ability to use a web proxy, using your current session's | |
credentials. Might add option to use other credentials, if there's demand. | |
It also adds a 'BL' (Bootleg) prefix to the nouns, just to prevent confusion with the "real" | |
cmdlets. Feel free to remove them. |
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
import sys | |
import pprint | |
import struct | |
import socket | |
import ssl | |
from time import sleep | |
# Standard "HELLO" message for TDS | |
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20, | |
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00, |
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( | |
[string]$Exe7z, | |
[string]$PackageDir, | |
[string]$InstallDir | |
) | |
Function Expand-ToDirectory { | |
param( | |
[string]$Archive, | |
[string]$TargetDir |
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
Register-ArgumentCompleter -Native -CommandName Should -ScriptBlock { | |
param ($WordToComplete, $CommandAst) | |
$options = @( | |
'Be' | |
'BeExactly' | |
'BeLike' | |
'BeGreaterThan' | |
'BeLessThan' | |
'Contain' | |
'Match' |
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
Add-Type @" | |
using System; | |
using System.Runtime.InteropServices; | |
public class NativeConsoleMethods | |
{ | |
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | |
public static extern IntPtr GetStdHandle(int handleId); |
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(ValueFromPipelineByPropertyName = $true, Mandatory, Position = 0)] | |
[Alias("PSPath")] | |
[string]$Path, | |
[string]$OutputPath | |
) | |
process |
NewerOlder