GithubHelp home page GithubHelp logo

Comments (4)

mklement0 avatar mklement0 commented on June 24, 2024 1

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.

gsacavdm avatar gsacavdm commented on June 24, 2024 1

Good point. Thanks for taking the time to respond.

from clipboardtext.

mklement0 avatar mklement0 commented on June 24, 2024

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.

gsacavdm avatar gsacavdm commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.