Pass parameters from Read-Clipboard to implementation

This commit is contained in:
dfinke
2021-07-24 13:48:18 -04:00
parent 3121c5eaed
commit 99de9a9854

View File

@@ -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."