I've been experimenting with Powershell Core on linux. It took less than 10 minutes to install, and takes about 150megs of space. So
the barrier to usage is pretty low. It will be even lower if PS gets into the major distributions. For those who aren't familiar with
Linux distributions, in Linux most distributions come with a package manager. With a package manager you don't have to hunt down
software at individual web sites. Instead you just open the manager, tell it that you want Open Office, Firefox, and Gnumeric, and ina few minutes it's all installed.
The good news is that Polly's menus looked the same right out of the gate. Somehow PS handled the directory structures well enough
that nothing special had to be done to see the usage file or load settings.ini. Obviously, the part of TT's code that invokes notepad would
need to be tweaked.
So far the only thing PS has completely rejected is the BufferSize setting.
@TT -- how important is this setting? The screens looked OK. I'm thinking it would be possible to wrap the code with a check for platformso it doesn't throw an error.
There were some conflicts between linux alias names and PS names. They can be resolved by using full PS names.
There may or may not be some issues relating to the path separator, but further testing is required.
At the moment it looks like it might be possible to make Polly forward compatible with Powershell Core 6,
Just uploaded a new branch:This version is hopefully forward compatible with Powershell Core 6. That is, youcan use it with PS 5, and also with PS 6 -- which means it can be used withLinux and maybe Mac OS.Looking for feedback to make sure nothing has broken with it running under standard PS 5.For use under Linux, there is no documentation yet. But you can just run "pwsh" tostart powershell, and then from there invoke the script with polly.ps1. After invoking,a starter settings.ini file will be created, but still using windows defaults. Quit out of thescript and use your favorite editor to modify settings.ini. Then start the script again.Not sure if environmental variable expansion works, but it should be able to make use ofdirectory names that start with / or ~ .
For instance, maybe platform dependent # INTERNAL SETTINGS might be moved to secondary scripts or .\lib\win-internal.ini, .\lib\mac-internal.ini & .\lib\unix-internal.ini?
What is the equivalent of a Windows "batch" file?
TT
Mark S. wrote:especially in the context of USB testing, that you mightwant to try some larger files to give a more realistic experience.
@TiddlyTweeter wrote:
Right. I overlooked that so far!Now there is testing structure I'll make a "Performance" version as it will be easy.
Hence also the random thoughts about robocopy, which is supposedly morerobust than standard copy, but actually I don't know if it's more robust thanthe copy function built into PS.
Thanks BTC
Say I write this in Windows BATCH ...powershell -file .\polly.ps1 -run "menu" -ini "t_relative-USB.ini"... the bat file can be clicked to run from file explorer GUI. File called "t_relative-USB.bat"
In BASH would it be as simple as? ...
@TiddlyTweeter:
Say I write this in Windows BATCH ...powershell -file .\polly.ps1 -run "menu" -ini "t_relative-USB.ini"... the bat file can be clicked to run from file explorer GUI. File called "t_relative-USB.bat"
I would call it t_relative-USB.sh
(Update: Just pushed an update to core-enabled to fix a problem in the variables discussed below.)If you're running PS Core 6, then there are 3 helpful variables:$isWindows$isMacOS$isLinuxTo tell you what platform you are on. These variables don't exist in PS 5, so I faked them at thetop, under the assumption that 5 will only run on Windows.There is also a platform separator character (long complicated name) which I put into $SEPARATOR anduse everywhere in the new version (even though in many cases, but not all, PS can figure out the pathing).So far there haven't been any separate *.ini settings.The main thing is that users will need a different settings.ini file for each environment because of the pathing.
More research into string splitting needed.
This code kind of does that already.
$isWindows$isMacOS$isLinux
These variables don't exist in PS 5.
There is also a platform separator character (long complicated name) which I put into $SEPARATOR anduse everywhere in the new version (even though in many cases, but not all, PS can figure out the pathing).So far there haven't been any separate *.ini settings.
But it kind of looks like if users use "/" for their pathing, and not absolute pathing (e.g. "C:/...") then it mightwork for both platforms without changes.
Removed: Unneeded "\"
Changed: Pathing to scripts to Unix style
Changed: Many aliases changed to full cmdlet names
Added: Additional timing setting for "once-menu" refresh cycle
Cosmetic changes
TT
Ok. Standing by ..
.\dev\do-pathcheck.ps1 tool to check any path to dirs or files, allows relative addressing on check and wildcards;.\dev\do-grabwiki.ps1 experimental tool to capture directory listings for wikis and bulk convert into .ini data, allows relative addressing on check and wildcards
[wikis] --- WIKIS FOR RESTORE: one per line in format: "label1=path-to-wiki-file" file1=C:\TW\Polly\tw-wikidir\*.html
I have asked this question earlier! After backup and zip why the files still in Downloads dir?Why not keep Downloads dir tidy?
Ciao MohammadDo you mean that whilst creating setting you could add multiple wiki based on a full path with wildcards. If so, its possible.
IF you mean auto-detection at run-time of wiki within a directory (including recursively through sub-folders) that would not be for the [wikis] section. The wikis section should remain one wiki per line. But I could add tools to automate their addition when first creating an .ini file.BUT Mark S. is looking into having a dynamic, run-time, way to add all wikis (recursively) within a folder structure using a wikidirs approach. This issue on GH: https://github.com/Marxsal/polly/issues/16 is a starting on that theme.
Ciao MohammadMohammad wrote:I have asked this question earlier! After backup and zip why the files still in Downloads dir?Why not keep Downloads dir tidy?I'm not sure. I want to explain some implications.1 -- It is important to understand that Polly backups and zip-archives (by design) are always one step behind their current wiki.That means for the latest restored the only backup is the Downloads version.
2 -- It is possible (not documented yet) to run a second .ini file that restores to a secondary address. If you auto-deleted Downloads that would prevent that from working.A possible solution might be a "maintenance" tool that tidies up when explicitly launched.But, I'm not sure what Mark thinks about all this?
TT
Before Polly there were problems on automation.
No longer. Polly solves them all.
By Roosting right in.
Unlocking the potential of TiddlyWiki ...
With Polly.