PowerShellFar — Windows PowerShell host for Far Manager

Анонсы новых плагинов. Обсуждение плагинов ведется ниже.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

Latest post of the previous page:

1.1.6

Far.NET 3.3.6: http://forum.farmanager.com/viewtopic.php?p=21256#21256

- Included new version of PowerShell.hrc for Colorer-take5.beta5: it works for
both .ps1 and .psfconsole files. Note that this version contains prototype
definition in it, so all you need is to add a link to this file to your Colorer
catalog.xml. PowerShell.hrc was significantly improved itself.
- Added a number of new features to "Editor console": Up\Down ~ prev\next
command; End ~ menu of commands with the same prefix; Escape ~ clear the line.
Fixed a few issues.
- Updated scripts according to recent Far.NET changes in menus ('Selected').
- Complete-Word-.ps1 in .psfconsole files takes words also from history.
- Tiny improvement in TabExpansion.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.7

Far.NET 3.3.7: http://forum.farmanager.com/viewtopic.php?p=21644#21644

- New background job helper New-Job-.ps1 and its demo in Test-Job-.ps1.
- PowerShell.hrc: added outlined ### comments and other minor improvements.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.8

- Fixed an error message on viewing an already discarded background job.
- Ctrl+C stops the current command at the moment of any output or PowerShell UI
operation. This solution is quite dirty but it is better than nothing at all.
See also help topic "Restrictions".
- $Psf: new properties: Paths2, CurrentPath2, SelectedPaths2 for passive panel.
- $Psf: new properties: Items, CurrentItem, SelectedItems, Items2, CurrentItem2,
SelectedItems2 - native PowerShell items (same as from cmdlets Get-ChildItem,
Get-Item, etc.), they are useful in PowerShell command lines.
- .psfconsole: simple rule: if any selection exists the editor always acts as
standard editor.
- PowerShell.hrc: improved keywords if, for, foreach, while, until and others.

plugin: http://farnet.googlecode.com/files/Powe ... .1.1.8.rar
Far.NET 3.3.8: http://farnet.googlecode.com/files/Far.NET.3.3.8.rar
Far.NET help: http://farnet.googlecode.com/files/FarNET.doc.3.3.8.rar
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.9

- Completely remade Search-Regex-.ps1: it is now a real tool, not just a demo:
search is performed in the background, results are sent to a FAR panel, you can
start work with them while search is still in progress, found lines are opened
in non-modal editors, etc.
- Implemented quick and dirty version of "Power panel" - FAR panel exploring
PowerShell EFS (extended file system). Thus, you can browse: file system itself
(not a big deal but you can map and use PS drives, e.g. MyDrive:\), registry
(hkcu:\, hklm:\), environment variables (env:\), certificats (cert:\), PS
aliases (alias:\), PS functions (function:\), PS variables (variable:\) and, if
you add any external PS provider then (theoretically) you can browse its EFS as
well. WARNING: in Power panel all typed commands are executed as PowerShell
commands no matter with or without a prefix; it is handy but you have to take
care.
- Disabled background jobs notification in the console title (for now or ever?).

plugin: http://farnet.googlecode.com/files/Powe ... .1.1.9.rar

Far.NET
plugin: http://farnet.googlecode.com/files/Far.NET.3.3.9.rar
help: http://farnet.googlecode.com/files/FarNET.doc.3.3.9.rar

Hello World in a FAR file panel:

Code: Select all

$panel = $Far.CreatePanelPlugin($true)
$file = $Far.CreatePanelItem()
$file.Name = 'Hello World!'
$panel.Files.Add($file)
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.10

- Search-Regex-.ps1: <Enter> on a found match: cursor in editor is positioned
at the found match and, in standard (line) mode, the matched text is selected.
Added -AllText mode: search is performed on the whole file text, i.e. you can
find multi-line matches, too. Improved communication between threads. <Esc>
closes the panel.
- Power panel: fixed bugs and issues, implemented many new features, see help.
WARNING: Power panel is still very experimental, please, be careful. But it is
already preliminary tested with 10 different data store providers.
- Fixed a recent bug on closing PS session.
- PS confirmation is now implemented as FAR dialog (not a menu used before),
e.g. on "del MyFile.txt -confirm" and etc. starts a dialog.

plugin: http://farnet.googlecode.com/files/Powe ... 1.1.10.rar
+ (required)
Far.NET: http://farnet.googlecode.com/files/Far.NET.3.3.10.rar
+ (optional)
Far.NET help: http://farnet.googlecode.com/files/FarN ... 3.3.10.rar
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.11

- Revised internal invocation of PowerShell, as a result some restrictions no
longer exist.

Power panel:
- Description column contains preview of item data. Note: Description mode can
take significant time for large number of items.
- Provider settings for Description column can be defined via $Psf.Providers,
see Profile-.ps1 for examples and help for more details.
- Fixed some provider oddities (bugs?) and other issues.

- Implemented PowerShell host methods {Enter|Exit}NestedPrompt(); now you can
suspend\resume execution: it is suspended by modal editor console (.psfconsole)
where you can run nested PS commands and investigate output just in the editor.
To exit this mode run "exit" (it closes the editor silently) or exit the editor
as usually (and optionally save its contents). This feature is useful for
debugging and diagnostic: for example now you can enable 'Inquire' error mode by
setting $ErrorActionPreference = 'Inquire' (global or local). In this mode on
any error you will see a dialog with an error message and choices: [Continue]
[Silent Continue] [Break] [Suspend] - choosing [Suspend] you can investigate the
case and then decide: [Continue] [Silent Continue] or [Break]. Then, if you use
-Confirm switch for a PS cmdlet then one of the choices is [Suspend], too.

plugin: http://farnet.googlecode.com/files/Powe ... 1.1.11.rar
+ (required)
Far.NET: http://farnet.googlecode.com/files/Far.NET.3.3.11.rar
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.12

Output and plugin settings:
- Commands output is now shown by the internal FAR viewer (with tmp files);
- As a result, settings PluginLogFile, PluginLogViewApp, PluginLogViewArgs were
removed;
- Remaining settings now live in the Registry, you should manually remove:
\Local Settings\Application Data\Eugene_Roshal_&_FAR_Group\..\user.config
(and set your settings again: startup code, user command, etc.).

Refactoring:
- created internal profile "PowerShellFar.ps1" (it has to be copied to the same
location where "PowerShellFar.dll" is). User profile is loaded after this system
profile, so that a user can redefine some features.
- moved functions `Clear-Host`, `more` from demo profile "Profile-.ps1" to this
system profile (because they are actually not optional).

Power panel:
- reduced number of data reads (e.g. improved network performance). -
- fix: new item (F7) should not overwrite an existing with the same name.
- added ShiftF5: copy here with a new name (if supported by a provider).
- CtrlA is used for properties (not CtrlPgDn, it will be used differently).
- access to properties of .. item, e.g. CtrlA at .. when path is hkcu:\
- improved view\edit of properties which values are arrays of primitive types
(e.g. you can edit types Binary and MultiString in Registry).
- Patch for (default) property of Registry (see help).

plugin: http://farnet.googlecode.com/files/Powe ... 1.1.12.rar
+ (required)
Far.NET: http://farnet.googlecode.com/files/Far.NET.3.3.12.rar
+ (optional, not much changed)
Far.NET help: http://farnet.googlecode.com/files/FarN ... 3.3.12.rar
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.13

Installation:
- copy all files "PowerShellFar*" to your "%FARHOME%\Plugins.NET\PowerShellFar"

Power panel:
- New mode: "Objects" - any PowerShell objects, for example output of commands,
i.e. ">: ps | pp" shows all processes in the panel with some properties in the
description column, then you can select one and view (F3) or quick view (CtrlQ)
all its properties - thus, it works like ProcList plugin but provides much more
information. NOTE: process list is only an example, you can put any objects to
the panel and get their information.
- $Psf.{Paths|Items}[2]|Current{Path|Item}[2]|Selected{Path|Item}[2]: if the
panel is a Power panel then Paths are valid original Unicode paths, Items are
any panel objects in object mode or provider items in provider mode.
- PowerShell function Start-PowerPanel moved from demo Profile-.ps1 to internal
profile PowerShellFar.ps1 and updated for the Object mode.
- Now Power panel can be opened also from FAR disk menu.
- Updated help for Power panel.

Other changes:
- Fixed unwanted global variables from PowerShellFar.ps1 functions.
- Changed logic of $Psf.Selected{Paths|Items}[2]: it includes selected elements
if any else the current element if it is not '..' else nothing;

ETS: Description property for file and directories:
- Take a look at the first experiment with PowerShell ETS (extended type
system): now in PowerShellFar any IO.DirectoryInfo and IO.FileInfo object (e.g.
what you get from Get-*Item, but not only) has property Description which is FAR
text from description file Descript.ion. Cool, isn't it? It is done completely
in PowerShell (i.e. no C# coding or whatever): see PowerShellFar.types.ps1xml
and PowerShellFar.ps1 (command Update-TypeData, function Get-FileDescription).
Silly example: >: dir | ft Name,Length,Description -a

PowerShellFar: http://farnet.googlecode.com/files/Powe ... 1.1.13.rar
Far.NET plugin: http://farnet.googlecode.com/files/Far.NET.3.3.13.rar
Far.NET help: http://farnet.googlecode.com/files/FarN ... 3.3.13.rar
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.14

Power panel:
- F4: internal non-modal internal editor, AltF4 - Notepad, usually modal.
- CtrlPgDn: panel with the current object members (like Get-Member), see help.
- removed methods $Psf.StartPowerPanel() (avoiding duplicated functionality).
Instead, use the predefined function Start-PowerPanel (alias pp) or create\open
a panel directly using New-Object and PowerShellFar classes.
- many internal changes using new FAR.NET panel features.

ETS (Extended Type System):
- Import-FileDescription, Get-FileDescription can get info from any "Descript.*"
file (if there is one and only one in a directory).

- new scripts *-Feed*.ps1 allow download and preview Web feeds in a panel and
open their links in IE; they also show how to use Power panel with custom
objects (this approach is under construction).

plugin + requred FAR.NET 3.3.14 + optional FAR.NET help:
http://code.google.com/p/farnet/
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.15 (and required FAR.NET 3.3.15)
http://code.google.com/p/farnet/

- REMOVED script Show-Member-.ps1, because its functionality is covered now by
member mode of Power panel (class PowerShellFar.MemberPanel) and function
Show-Member (alias shm) defined in system profile PowerShellFar.ps1.

Member panel:
- CtrlShiftM: switches modes: 1) properties and values in a description column
(you can edit some properties in editor or in commands line using <Enter> and
prefix '=', see help; 2) all members with member info in a description column,
(and no changes allowed).

Property panel:
- <Enter> and prefix '=' allows to edit some properties just in the command line
(like in Member panel).

Other changes:
- new class PowerShellFar.Invoker: it is used for running scripts in another
runspace. It is designed first of all for running scripts in the background
(InvokeAsync()) and reading output during processing. Search-Regex-.ps1 shows
how to use it.
- converted $Psf.TabExpansion from event to a simple event handler.
- removed $Psf.CreateJob() as dupe of "New-Object PowerShellFar.Job".
- added helper function Get-FarData (and alias gfd), see PowerShellFar.ps1
- updated help topic "Power panel".
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.16 (and FAR.NET 3.3.16 + docs)
http://code.google.com/p/farnet/

PowerShellFar.DataPanel:
- new panel allows to work with database data with all set of main operations:
select, update, insert, delete (of course you don't have to type these commands
in a panel, you do it once in a script via data adapter). Test-DataPanel-.ps1
shows all this for SQL Server Express 2005.

Object panel:
- <CtrlS> exports objects to .clixml file; see also new Import-Panel-.ps1

Member panel:
- <Del> deletes properties (if possible, usually PSCustomObject NoteProperty).

Misc:
- improvements in all Power panels.
- functions not used by PowerShellFar moved from system PowerShellFar.ps1 to
folder Bench as scripts, aliases moved to demo user profile Profile-.ps1, some
names changed: Get-FarData -> Get-Data-.ps1, Show-Member -> Panel-Member-.ps1,
Show-Property -> Panel-Property-.ps1, Start-PowerPanel -> Panel-Item-.ps1 and
Panel-Object-.ps1; aliases: gd, pi, pm, po, pp.
- command output to console or viewer - viewer is started if output is going to
be not completely visible (panel visibility and height is taken into account),
i.e. normally you don't have to hide panels to see output.
- PowerShell.hrc - suffix d|D for 'decimal' number type.

OBSOLETE:
- $Psf.From will be removed; please, use $Far.From.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.17 (and FAR.NET 3.3.17)
http://code.google.com/p/farnet/

PowerShellFar.DataPanel:
- F7: when a new record is added its Member panel is opened, so that you can
start to edit data immediately (it seems quite natural). Then you are prompted
to save the added record when you return to the table panel.
- Manual changes are normally committed to a database automatically (you are
just prompted to confirm). Other changes (e.g. done by scripts) still can be
saved by <CtrlS>. <CtrlS> can also be used in Member panel when you edit a
record data.
- Other minor improvements and fixes in Data and other Power panels.

OBSOLETE:
- removed obsolete $Psf.From; please, use $Far.From.
- remainder: FAR.NET: removed obsolete properties {ILines | IStrings}.Text;
please, use methods {IEditor | ISelection}.{GetText | SetText}.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.18 (and FAR.NET 3.3.18)
http://code.google.com/p/farnet/

- The plugin keeps its settings in IFar.RootKey + '\PowerShellFar'; this also
fixes problems on starting the plugin with '/u' parameter in FAR command line.
- Improved panel modes: Member and Property panels start in Description modes;
parent panels restore their initial modes when child panels are closed.
- Improvement in Object panel: you can open (<Enter>) results of Group-Object,
e.g. after commands like this:
>: Get-Command * | Group-Object CommandType | Panel-Object-
you can enter into groups (in this example: Alias,Cmdlet,..) and view items.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.19 (and FAR.NET 3.3.19)
http://code.google.com/p/farnet/

- New script Panel-Data-.ps1 - advanced helper for PowerShellFar.DataPanel (see
how it is used in Test-DataPanel-.ps1).
- Added demo CSV ~ function ShowCsvData to Test-DataPanel-.ps1 - it shows how to
panel data from CSV files using OleDbConnection and Microsoft.Jet provider.
- Object panel and Member can open (<Enter>) IEnumerable objects - their items
are shown in a child Object panel.
- Object panel can open(<Enter>) ManagementClass object (e.g. from Get-WmiObject
-List). It also can open results of Group-Object, thus, you can create and browse
quite complex object structure by commands like this (browse WMI classes grouped
by dynasty; warning: avoid opening 'unknown' items - some WMI items take ages):
>: Get-WmiObject -list | Group-Object __DYNASTY | Panel-Object-
- Member and Property panels: default sort mode is 'Unsorted' (it was not set);
- Object panels: start view mode is not set (it was 'Descriptions', which can be
very time consuming for large number of objects with many properties).
- Internal (but public) function NativeMethods.SetActiveWindow was renamed into
ShowWindow.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.20 (and FAR.NET 3.3.20)
http://code.google.com/p/farnet/

VIEW CALL STACK ON ERRORS ($ErrorActionPreference = 'Inquire')

For the sake of better troubleshooting of your scripts and just for experience I
set $ErrorActionPreference = 'Inquire' in demo Profile-.ps1 (just in case if you
use it or you can set it in your profile).

Advantages: you have a choice what to do on an error: continue; silently
continue; break; suspend and invoke intermediate commands in Editor console; use
NEW FEATURE - view call stack on error (<Esc> in error message dialog).

Disadvantages: can be annoying if you simply compose a new command; not all
scripts allow interaction, e.g. inside DB transactions (but actually in this
case you can explicitly set $ErrorActionPreference = 'Stop\Continue' in a
script or any other scope).

Anyway, it is up to you what $ErrorActionPreference to use, but the new feature
'view call stack' useful for troubleshooting is available only in error dialog,
i.e. when $ErrorActionPreference = 'Inquire'.

OTHER CHANGES

- Minor improvements in TabExpansion-.ps1
- Fixed example 'Tables' in Test-DataPanel-.ps1
- Editor console: <= and => are used as command output markers.
- Plugin menu command "Run selected code" being invoked from the command line
with no selection (i.e. full text) clears the command line on success and keeps
the text on errors so that you can correct the text immediately.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Post by NightRoman »

1.1.21 (and FAR.NET 3.3.21)
http://code.google.com/p/farnet/

DATABASE TOOLS

- New script Panel-Table-.ps1: show tables and views of an open connection $DB
in a panel. <Enter> opens a selected table by Panel-Data-.ps1: depending on a
table and a connection you can insert, delete and update records; <Esc> returns
you back to the parent panel with tables.

- New script Panel-Database-.ps1 (designed and tested for SQL Server Express):
shows all databases; <CtrlPgDn> opens database properties, <Enter> opens list of
tables in the database (it is done by Panel-Table-.ps1, see above).

- You can now configure your table panels to take some fields values from
another (lookup) table panel. See how it is done in Panel-TestNotes-.ps1: when
you <Enter> Category field then another Panel-TestCategories-.ps1 is called
where you: can <Esc> to exit with no changes, <Enter> to set selected Category
as new value in TestNotes record, or before <Esc> or <Enter> you can work with
lookup table as if it is opened directly, i.e. you can add, remove, edit
records (use <CtrlPgDn> to enter a record because <Enter> is used for lookup).

- Other minor changes in scripts and code mostly related to new tools above.

TEST SCRIPTS

- Test scripts moved to Bench\Test directory and some test rules changed, read
About-Test.txt if you want to run some tests, especially database test panels.
- Functions from Test-DataPanel-.ps1 was transformed into Panel-Table-.ps1 and
advanced test scripts in Test directory; script itself was removed.

MISC

- Demo Profile-.ps1: $ErrorActionPreference = 'Stop' again. 'Inquire' mode is
really good for troubleshooting but it is too annoying for normal work when
errors are not due to bugs in code.
Post Reply

Return to “Анонсы новых плагинов”