Skip to content

Instantly share code, notes, and snippets.

View juvtib's full-sized avatar

Michael Mientus juvtib

View GitHub Profile
‑ Non-breaking Hyphen
& Literal Ampersand
  Non-breaking Space
$a = ""
$myFile = "C:\Users\Michael\Desktop\Vim\temp.txt"
get-content $myFile | ? { $_ -match "^\w" } | % { $a += "`"$_`" " }
$a | set-content $myFile
$host.ui.rawui.WindowTitle = "Mike's PowerShell"
function prompt {
$logFile = "C:\Users\Michael\Documents\PowerShell Log.txt"
$lastCommand = get-history –count 1
if ($lastCommand)
{
# There is a command in history.
$whenDidItRun = Get-Date –Date $lastCommand.StartExecutionTime –Format 'yyyy MMMM dd HH:mm:ss'
$logEntry = "$whenDidItRun> $($lastCommand.CommandLine)"