From bfc27cfa9177166044e9996364df81521a8bd1bd Mon Sep 17 00:00:00 2001 From: Matt Kotsenas Date: Fri, 29 Jan 2016 16:57:28 -0800 Subject: [PATCH] Updating PowerShell alias --- Shell-aliases.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Shell-aliases.md b/Shell-aliases.md index 1d66528..194cc0b 100644 --- a/Shell-aliases.md +++ b/Shell-aliases.md @@ -25,11 +25,12 @@ Put this in your Powershell `$PROFILE` on Windows: ```powershell function fuck { - $fuck = $(thefuck (get-history -count 1).commandline) - if($fuck.startswith("echo")) { - $fuck.substring(5) + $fuck = $(thefuck (Get-History -Count 1).CommandLine) + if (-not [string]::IsNullOrWhiteSpace($fuck)) + { + if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5) } + else { iex "$fuck" } } - else { iex "$fuck" } } ```