-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Set-Clipboard in PowerShell Core on Windows Results in Throwing CommandNotFoundException #4307
Copy link
Copy link
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Description
Set-Clipboard throws a CommandNotFoundException in PowerShell Core on Windows. There is a similar issue #3618 open for Mac. A workaround could be piping to clip.exe in Windows but this passes functionality out of PowerShell.
Steps to reproduce
Get-Content -Path myfile.txt | Set-ClipboardExpected behavior
Text piped or passed into command should get set to the clipboard.
Actual behavior
Get-Content -Path myfile.txt | Set-Clipboard
Set-Clipboard : The term 'Set-Clipboard' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:32
+ Get-Content -Path myfile.txt | Set-Clipboard
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-Clipboard:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptionEnvironment data
$PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.4
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module