From 99de9a98547ef61455e51de0a056e7db018152fa Mon Sep 17 00:00:00 2001 From: dfinke Date: Sat, 24 Jul 2021 13:48:18 -0400 Subject: [PATCH] Pass parameters from Read-Clipboard to implementation --- Public/Read-Clipboard.ps1 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Public/Read-Clipboard.ps1 b/Public/Read-Clipboard.ps1 index 9e20879..1195232 100644 --- a/Public/Read-Clipboard.ps1 +++ b/Public/Read-Clipboard.ps1 @@ -25,7 +25,19 @@ function Read-Clipboard { if ($IsWindows) { $osInfo = Get-CimInstance -ClassName Win32_OperatingSystem if ($osInfo.ProductType -eq 1) { - ReadClipboardImpl (Get-Clipboard -Raw) + $cvtParams = @{ + Data = Get-Clipboard -Raw + } + + if ($Delimiter) { + $cvtParams.Delimiter = $Delimiter + } + + if ($Header) { + $cvtParams.Header = $Header + } + + ReadClipboardImpl @cvtParams } else { Write-Error "This command is only supported on the desktop."