Comments (4)
That's all very mysterious; clip.exe
should be in C:\Windows\system32\clip.exe
, and C:\Windows\system32
should always be in $env:PATH
.
What does (Get-Command clip.exe).Source
report?
Are there malformed entries in $env:PATH
?
What does nowadays mean? Did you upgrade to a new PS Core version, and what is that version?
from clipboardtext.
I cannot reproduce on my pwsh
with latest Windows 10. Ad PATH check, @greenmooseSE can you also compare cmd path with PSCore path? It should be the same, but you never know. What the command "$(cmd.exe /c PATH)" -eq "PATH=$($env:PATH)"
gives you in PS Core?
However, I did this test and it shows unexpected behaviour.
I copied clip.exe from system32 to my current location, i.e. c:\temp
. Then inside of that folder, I executed cmd.exe /c clip.exe /?
and I got nothing for the output.
Regardless of the root cause of a problem, @mklement0 can solution be to use full path instead of clip.exe here?
from clipboardtext.
Investigated a bit more and my issue seems to be when invoking cmd.exe
from a pwsh.exe
shell the %PATH%
variable get corrupted (for whatever reason it seems to be too long) so my standard items that should be part of PATH are not working either.
When I am invoking cmd.exe
via Start->Run, or from a "standard powershell" shell, it works as expected and the length of %PATH%
value is a lot smaller.
Difference in size when doing echo %PATH% >file.txt
:
(So far I have not had any issues with this other than when using ClipboardText, I have modified it locally though with above change to get it working for me)
from clipboardtext.
Thanks, guys.
Even though the problem turned out to be external to this module, I've decided to follow @iricigor's suggestions and use full paths for the execution of the external shells and clipboard programs (where known) in the just-published https://www.powershellgallery.com/packages/ClipboardText/0.1.8
Using full paths for executables in known locations is preferable from a security and predictability standpoint.
However, @iricigor, I'm mystified by your clip.exe
-in-c:\temp
example - did you find the cause?
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
- Enable Set-Clipboard and Get-Clipboard aliases HOT 4
- Can clipboard usage in a spawned shell be supported as well? HOT 1
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.