The Set-Alias command does not support adding parameters to your command as PowerShell will interpret that as parameters for the Set-Alias rather than parsing them through as the alias.
Instead, you need to create a function, call the new command from there, and use Set-Alias to give that function a new name.
PS> Function remove-...
The comparison is fine, the problem is that you're missing the variable to compare against. Because your entire SSH command line is inside double quotes, the $5 is eaten by your local shell before it even gets to 'ssh' – you must type it as \$5 to avoid that. Same goes for the $0 later (notice how the error message says "print bash;" in its place).
But whatever I try to start wsl.exe from within my Tcl scripts, using
the (Expect-) 'spawn' command or even simply:
exec C:\Windows\system32\wsl.exe $lnxcmd $params ,
I get either 'file not found' for wsl.exe or no response at all.
Maybe your path is wrong, I don't use Tcl/tk but from what I can read here : https://www.tcl.tk/man/tcl8.3/TclCmd/...
Half of the script is unnecessary. Remove all checks for time. Just set it to check for name and delete.
Then set it in the crontab on each minute.
If you want to stop it for some reason, just stop the cron by commenting the execution line and restart the cron
See the Set DEBUG=echo line?
Disable this line with REM or :: when you are sure that it is doing what you want it to do. This script is harmless while it exists.. not so much if you remove it.
The if /i not "%DownloadsDir%" == "%CD%" line comes from being stupid and blowing away all of my files in the wrong directory when I was younger and dumber.
I agree with other comments. You would need a second machine running a connectivity test or something of the sort to the machine that is running the other code to detect a failure. Here is a sample powershell script that would email you if it did not get a successful ping response back from the other machine. Following code assumes you use 0ffice365 mail/...
I agree with Worthwelle. There would need to be another machine monitoring the status of the machine where that script was being run. In this case, if there was a machine that was reliable enough to monitor the first machine, then you might as well just run the script on that machine instead. Best solution... correct the issue causing machine running the ...
It seems python outputs its version to stderr, not stdout. So, redirect stderr to stdout in order to capture it
pythonVer=$(ssh "$user"@"$ip" 'python --version 2>&1')
pythonVer=$(ssh "$user"@"$ip" 'python --version' 2>&1)
The answer from xenoid made me research a little bit about imagemagick (which I didn't know beforehand). After some trial and error I got the (at least for me) optimum process.
First of all we convert our image into grayscale with a threshold of 40%
convert input_image.jpg -colorspace gray -auto-level -threshold 40% output_image.jpg
Then, If there are ...
[magick] mogrify -level 20%,80% yourfile.jpg
New file version:
[magick] convert input.jpg -level 20%,80% output.jpg
Where 20% and 80% are the luminosity under/over which everything becomes pure black/white.
Depending on version used, commands are mogrify and convert (old version) or magick mogrify and magick convert (...
For posterity, I hit this on my Mac after renaming a shell file in Finder that was open in BBEdit. Then, when I modified the file in BBEdit (which correctly reflected the new filename) and saved, I could no longer run the script.
For me, the fix was as simple as quitting BBEdit and re-launching, then saving the file once more. 🤷♂️
My issue was happening ...
Check out RunJS
I recently have started using RunJS on my mac - it is such a great tool and helps me immensely to test out things quickly.
RunJS is available for the Windows machine as well. You can find download link here
No matter I tried I couldn't reliably change wallpaper with regedit and UpdatePerUserSystemParameters (even with large loops), so I ended up using powershell, it works every time.
# use powershell.exe Set-Wallpaper.ps1 -Image "<path to image>"