---
title: "PowerShell Copy to Clipboard: Beyond Ctrl+C and Ctrl+V"
description: "Discover the PowerShell Copy to Clipboard function and move beyond traditional shortcuts."
canonical: "https://adamtheautomator.com/powershell-copy-to-clipboard/"
---

# PowerShell Copy to Clipboard: Beyond Ctrl+C and Ctrl+V

> Discover the PowerShell Copy to Clipboard function and move beyond traditional shortcuts.

Source: https://adamtheautomator.com/powershell-copy-to-clipboard/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![PowerShell Copy to Clipboard: Beyond Ctrl+C and Ctrl+V](https://adamtheautomator.com/wp-content/uploads/2019/08/clipboard-23638_1280.png)

# PowerShell Copy to Clipboard: Beyond Ctrl+C and Ctrl+V

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)1 August 20192 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Old School clip.exe](#old-school-clip-exe)
*   [Set-Clipboard Powershell Command](#set-clipboard)
*   [Get-Clipboard Parameters](#get-clipboard-parameters)
*   [Clipboard Manipulation in PowerShell Core](#clipboard-manipulation-in-powershell-core)
*   [Summary](#summary)

When writing code in [PowerShell](https://adamtheautomator.com/tag/powershell/) the last thing you might think about is  
the Windows clipboard. We all probably know the infamous Ctrl-C and Ctrl-V keyboard shortcuts to copy and paste from the clipboard but this is typically done via the GUI. In our PowerShell scripts, it’s not too useful. However, did you know that there is PowerShell copy to clipboard function?

In this article, I’m going to go over how we used to get copy and paste functionality in PowerShell and then introduce you to the cmdlets that PowerShell provides starting in version 5.

Prior to PowerShell v5, the only way to copy to the clipboard was by using the _[clip.exe](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/clip)_ application.

## Old School clip.exe

This application had been around a long time and just worked. By piping text to clip.exe, you could get text copied onto the clipboard. This worked but it was always annoying when it added a carriage return after each entry.

```powershell
PS51> Write-Output 'Hello' | clip
```

![Copying to clipboard with clip.exe](/wp-content/uploads/2019/08/image-5.png)

The PowerShell copy to clipboard function can replace the old school clip.exe

Not only that but we had no easy way to pull information from the clipboard. We were forced to manually paste the contents once they were in the clipboard. With the native clipboard commands, this is no more!

We now have two cmdlets that solve this problem much better; `Get-Clipboard` and `Set-Clipboard`.

## Set-Clipboard Powershell Command

[`Set-Clipboard`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-clipboard?view=powershell-5.1) replaces _clip.exe_ but behaves exactly the same. Now, instead of piping output to _clip_, you can use `Set-Clipboard`. If you do this, you’ll notice that the trailing carriage return is gone when you paste the contents somewhere.

The clipboard now only contains the string _Hello_.

```powershell
PS> Write-Output 'Hello' | Set-Clipboard
```

Another useful feature with `Set-Clipboard` is the `Append` parameter. Traditionally, the clipboard has only been able to store one item. Now, by using the `Append` parameter with `Set-Clipboard`, you can add an unlimited number of items without removing the previous.

```powershell
PS> Write-Output 'Hello' | Set-Clipboard -Append
```

## Get-Clipboard Parameters

Even if you don’t use `Set-Clipboard` to copy contents to the clipboard, you can still use [`Get-Clipboard`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-clipboard?view=powershell-5.1) to understand a few different types other than simple strings. For example, if you’ve copied and a list of files from _File Explorer_ and you’d like to get this list into your PowerShell console, simply use the `Format` parameter and the �`FileDropList` value on `Get-Clipboard`.

```powershell
PS51> Get-Clipboard -Format FileDropList

Directory: \\Mac\Home\Downloads


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
------         8/1/2019  10:42 AM       17919094 00_03_xr30_whatyoushouldhave.mov


    Directory: \\Mac\Home\Documents\Snagit\Autosaved Captures.localized


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
------         8/1/2019   1:58 PM      169144472 2019-08-01_13-47-55.mp4
```

You can see that it understands the type of data in the clipboard is a list of files. Also, you can do the same with images and other entities.

Copy an image from another application and use provide `-Format Image` to `Get-Clipboard` to retrieve various properties about the image.

```powershell
PS51> Get-Clipboard -Format Image


Tag                  :
PhysicalDimension    : {Width=813, Height=113}
Size                 : {Width=813, Height=113}
Width                : 813
Height               : 113
HorizontalResolution : 96
VerticalResolution   : 96
Flags                : 335888
RawFormat            : [ImageFormat: b96b3caa-0728-11d3-9d7b-0000f81ef32e]
PixelFormat          : Format32bppRgb
Palette              : System.Drawing.Imaging.ColorPalette
FrameDimensionsList  : {7462dc86-6180-4c7e-8e3f-ee7333a7a483}
PropertyIdList       : {}
PropertyItems        : {}
```

## Clipboard Manipulation in PowerShell Core

Unfortunately, the `Get-Clipboard` and `Set-Clipboard` commands are not available in PowerShell Core (v6+) but you can still use them using the [WindowsCompatibility](https://github.com/PowerShell/WindowsCompatibility) module. The WindowsCompatibility module allows you to use Windows PowerShell cmdlets within PowerShell Core.

Once you have the WindowsCompatibility module installed, run `Invoke-WinCommand` and wrap your `Get-Clipboard` and `Set-Clipboard` references inside.

```powershell
PS622> Invoke-WinCommand -ScriptBlock {'This is on the clipboard' | Set-ClipBoard}
PS622> Invoke-WinCommand -ScriptBlock {Get-ClipBoard}
This is on the clipboard
```

You’ll find that you can read and write to the clipboard just as you would with Windows PowerShell.

## Summary

You can do so much more with the clipboard in PowerShell nowadays. The PowerShell copy to clipboard has been made possible using the `Get-Clipboard` and `Set-Clipboard`. These cmdlets allows you to use PowerShell to copy to the clipboard and to intelligently paste from the clipboard too.

For a full breakdown of the cmdlets, check out the detailed help:

```powershell
PS51> Get-Help Set-Clipboard -Detailed
PS51> Get-Help Get-Clipboard -Detailed
```

This will give you all of the various parameters that you can try out.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-copy-to-clipboard%2F&text=PowerShell%20Copy%20to%20Clipboard%3A%20Beyond%20Ctrl%2BC%20and%20Ctrl%2BV)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-copy-to-clipboard%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-copy-to-clipboard%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
