Last active
July 15, 2016 04:49
-
-
Save togakangaroo/b4bb392107aac2853bdf5615e2bc7458 to your computer and use it in GitHub Desktop.
My PS Profile
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
Import-Module pscx *>$null | |
$Pscx:Preferences['TextEditor'] = 'C:\Program Files\Sublime Text 3\subl.exe' | |
set-alias edit Edit-File -Scope Global | |
Set-Alias vim 'C:\Program Files (x86)\vim\vim74\vim.exe' | |
function Coalesce-Args { | |
(@($args | ?{$_}) + $null)[0] | |
} | |
function Change-ToNewDirectory($directoryName) { | |
mkdir $directoryName | |
cd $directoryName | |
} | |
Set-Alias ?? Coalesce-Args | |
Set-Alias ss Select-String | |
function Find-File([string]$pattern="*", $startAt=".") { | |
return Get-ChildItem $startAt -Recurse -Include $pattern | |
} | |
Set-Alias VBoxManage 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe' | |
function Control-Win8Dev($cmd) { | |
if(-not $env:Win8DevPassword){ | |
$env:Win8DevPassword = (Get-Credential "[email protected]").GetNetworkCredential().Password | |
} | |
VBoxManage --nologo guestcontrol "Win 8 Dev" execute --image "cmd.exe" --username "[email protected]" --password $env:Win8DevPassword --wait-exit --wait-stdout -- "/C" "powershell.exe" "-noprofile" "'$cmd'" | |
Write-Host "" #drop down a line | |
} | |
set-alias git 'C:\Program Files\Git\bin\git.exe' | |
function Remove-Trash( | |
[Parameter(Position=0, Mandatory=$false)][string]$Drive = "", | |
[switch]$NoConfirmation, | |
[switch]$NoProgressGui, | |
[switch]$NoSound | |
) { | |
add-type @" | |
using System; | |
using System.Runtime.InteropServices; | |
using Microsoft.Win32; | |
namespace recyclebin | |
{ | |
public class Empty | |
{ | |
[DllImport("shell32.dll")] | |
static extern int SHEmptyRecycleBin(IntPtr hWnd, string pszRootPath, uint dwFlags); | |
public static void EmptyTrash(string RootDrive, uint Flags) | |
{ | |
SHEmptyRecycleBin(IntPtr.Zero, RootDrive, Flags); | |
} | |
} | |
} | |
"@ | |
[int]$Flags = 0 | |
if ( $NoConfirmation ) { $Flags = $Flags -bor 1 } | |
if ( $NoProgressGui ) { $Flags = $Flags -bor 2 } | |
if ( $NoSound ) { $Flags = $Flags -bor 4 } | |
[recyclebin.Empty]::EmptyTrash($RootPath, $Flags) | |
} | |
ls C:\Users\gmauer\Documents\AutoHotkey\Startup -Exclude _* | ii | |
set-alias uniextract 'C:\Program Files (x86)\Universal Extractor\UniExtract.exe' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment