From 3fadc8ff6a58f8d5843a6b29c701d94deb53a4a5 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Sun, 25 Feb 2024 10:29:38 -0800 Subject: [PATCH] feat: Posh.Host.UI.Box.MiddleRight ( Fixes #366 ) --- Types/Posh.Host.UI.Box/get_MiddleRight.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Types/Posh.Host.UI.Box/get_MiddleRight.ps1 diff --git a/Types/Posh.Host.UI.Box/get_MiddleRight.ps1 b/Types/Posh.Host.UI.Box/get_MiddleRight.ps1 new file mode 100644 index 0000000..debba35 --- /dev/null +++ b/Types/Posh.Host.UI.Box/get_MiddleRight.ps1 @@ -0,0 +1,13 @@ +<# +.SYNOPSIS + Gets a box's Middle Right character +.DESCRIPTION + Gets the Middle Right character in a box +#> +$theseLines = @($this -split '[\r\n]+' -ne '') + +if (-not $theseLines) { return } +$theLine = $theseLines[[Math]::Floor($theseLines.Length/2)] +$theLine.Substring($theLine.Length - 1) + +