Comments (4)
Thanks for the suggestion, @gsacavdm, but given that we're only talking about 2 cmdlets, I'd rather not add another one just for enabling aliases.
from clipboardtext.
Good point. Thanks for taking the time to respond.
from clipboardtext.
Thanks, @gsacavdm, but I deliberately chose to avoid the names Set-Clipboard
/ Get-Clipboard
, because the functions in the module at hand are not full replacements for the Windows PowerShell cmdlets bearing those names: this module's function can handle only text, whereas the latter can also handle file objects (analogous to copying and pasting files in File Explorer), and Get-Clipboard
can additionally retrieve image and audio data.
-
If your scripts target PS Core only, there's no problem: you need to install/import this module anyway, and your scripts should then call
Set-ClipboardText
/Get-ClipboardText
-
If your scripts target both PS Core and WinPS, and you don't want to install this module for the latter, you can do something like the following:
if ($PSVersionTable.PSEdition -ne 'Core') {
Set-Alias Set-ClipboardText Set-Clipboard
Set-Alias Get-ClipboardText Get-Clipboard
}
from clipboardtext.
Hey @mklement0 , thank you for your response.
I assumed this was deliberate but wanted to confirm.
Did you also consider having an Enable-ClipboardAlias
command that sets up the alias on their behalf similarly to what the new Az module does with the Enable-AzureRmAlias?
from clipboardtext.
Related Issues (8)
- make it clear in readme that this runs on ALL PowerShell versions HOT 1
- version 5.1 fails in MTA mode HOT 1
- Remove dependency on Windows Script Host HOT 8
- CMD message if working directory is a UNC path HOT 3
- With Windows PowerShell, complains about missing xclip the first it's used if StrictMode is in effect HOT 2
- Can clipboard usage in a spawned shell be supported as well? HOT 1
- 'clip.exe' is not recognized as an internal or external command HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clipboardtext.