Sunday, December 2, 2018

PowerShell scripts

powershell.exe -Command { $i = 1 while ( $i -le 10 ) { Write-Output -InputObject $i Start-Sleep -Seconds 60 $i++ } }


I dumped the dollar sign format and just went with c style initialization of variables. Also, note the '-'mark.  MS is using somewhat of the linux command format.

PowerShell has this:
Object orientation

PowerShell is based on object not text. The output of a command is an object. You can send the output object, through the pipeline, to another command as its input.

This pipeline provides a familiar interface for people experienced with other shells. PowerShell extends this concept by sending objects rather than text.
This is great as long as we manage an object dictionary. Otherwise passing an object is passing a void*.   But MS has added a lot of objects with methods, some of which make windows and forms.  I am not doing that. One needs an entire object manager function, a .NET is what MS has.

My consideration is fine, add a complete object manager as a loadable device.  We will have to parse through the meth sequence to get at method identifiers, then utilize the object manager. No problem, but who decides the format for objects?  Dunno, haven't looked. Maybe GNU has the standard object format.

Without objects, and only the small part of scripting implemented, I am coming in at 900 lines of code. I am likely to quit and go back to join once I have something useful.


No comments: